
Note that the above equation is a first order non-homogeneous linear differential equation which is of the form

where (in the problem):

We can solve this equation by multiplying both sides by the integrating factor I(x) which is calculated as

Multiplying this integrating factor to both sides of equation (1), we have

Note that

Using this information for equation (2),

Now, we evaluate the integral on the left side. Let

so that

Using equation (4), equation (3) becomes

Since

, equation (5) becomes

Using this value of the constant, therefore
