In order to identify a nonhomogeneous differential equation, you first need to know what a homogeneous differential equation looks like. You also often need to solve one before you can solve the other.
Homogeneous differential equations involve only derivatives of y and terms involving y, and they're set to 0, as in this equation:

Nonhomogeneous differential equations are the same as homogeneous differential equations, except they can have terms involving only x (and constants) on the right side, as in this equation:

You also can write nonhomogeneous differential equations in this format: y'' + p(x)y' + q(x)y = g(x). The general solution of this nonhomogeneous differential equation is

In this solution, c1y1(x) + c2y2(x) is the general solution of the corresponding homogeneous differential equation:

And yp(x) is a specific solution to the nonhomogeneous equation.