# First order differential equation,integrating factor

Given the following differential equation i have to find the general solution using the integrating factor technique. $$\frac{dy}{dx}+\frac{y}{x}=e^x$$

I know that P(x) = $\frac{1}{x}$ and Q(x)=$e^x$ also i found $\mu(x)=e^{lnx}$

Using the formula $$y=\frac{1}{\mu(x)}{\int {\mu(x) Q(x)} dx }$$ i found this general solution: $$\frac{e^xx}{x}-\frac{e^x}{x}+\frac{C}{x}$$

Im not sure if this is correct.

• There's the one good way of checking if it works: substitute in the equation. – астон вілла олоф мэллбэрг Feb 7 '17 at 1:37
• substitute what in which equation? – super95 Feb 7 '17 at 1:43
• Your answer is correct. Much better if you write $$y=e^x-\frac{e^x}{x}+\frac{C}{x}$$ – Juniven Feb 7 '17 at 1:44
• Substitute the general solution in the differential equation. That is, replace $y$ by the general solution, in the differential equation. – астон вілла олоф мэллбэрг Feb 7 '17 at 1:45

To know if a solution of an E.D. is correct you just have to plug this into the original equation and derivate terms. In this case

$$\frac{d(\frac{e^xx}{x}-\frac{e^x}{x}+\frac{C}{x})}{dx}+\frac{(\frac{e^xx}{x}-\frac{e^x}{x}+\frac{C}{x})}{x} =^? e^x$$

Operating the LHS:

$$\dfrac{d(e^x)}{dx} - \dfrac{d(\dfrac{e^x}{x})}{dx} + \dfrac{d(\dfrac{C}{x})}{dx} +\dfrac{e^x}{x} - \dfrac{e^x}{x^2} + \dfrac{C}{x^2}$$

$$e^x - \dfrac{e^x}{x} + \dfrac{e^x}{x^2} - \dfrac{C}{x^2} +\dfrac{e^x}{x} - \dfrac{e^x}{x^2} + \dfrac{C}{x^2}$$

$$e^x$$

Therefore we can check that indeed

$$e^x = e^x$$

So your solution is correct