Problem 142
Medium Exact Equations

Show that the integrating factor for the linear equation…

Show that the integrating factor for the linear equation $y'+p(x)y=q(x)$ is $\mu(x)=e^{\int p(x)\,dx}$, and derive the general solution formula.

Explanation of Method

Rewrite as $M\,dx+N\,dy=0$ with $N=1$; the standard $\mu(x)$ test reduces directly to $\mu'/\mu=p(x)$, which integrates to the familiar exponential integrating factor, converting the left side into an exact derivative $\frac{d}{dx}[\mu y]$.

Step 1: Rewrite in differential form

$[p(x)y-q(x)]\,dx+dy=0$, so $M=p(x)y-q(x)$, $N=1$. Then $M_y=p(x)$, $N_x=0$, so the equation is (in general) not exact.

Step 2: Find $\mu(x)$

$\dfrac{M_y-N_x}{N}=\dfrac{p(x)-0}{1}=p(x)$, a function of $x$ alone, so $\dfrac{\mu'}{\mu}=p(x)$ gives $\mu(x)=e^{\int p(x)\,dx}$.

Step 3: Confirm the equation becomes exact

After multiplying, $M_1=\mu(x)[p(x)y-q(x)]$, $N_1=\mu(x)$. Then $(M_1)_y=\mu(x)p(x)$ and $(N_1)_x=\mu'(x)=\mu(x)p(x)$ (since $\mu'=p\mu$ by construction), so $(M_1)_y=(N_1)_x$: exact.

Step 4: Recognize the exact derivative and integrate

Since $\mu'=p\mu$, the original equation multiplied by $\mu$ reads $\mu y'+\mu p y=\mu q$, i.e. $\mu y'+\mu' y=\mu q$, i.e. $\dfrac{d}{dx}[\mu y]=\mu q(x)$. Integrating both sides in $x$ gives $\mu y=\int \mu(x)q(x)\,dx+C$.


Result

Final answer:

\[\boxed{\,\mu(x)=e^{\int p(x)\,dx}\,}\qquad\text{and}\qquad \boxed{\,y=e^{-\int p(x)dx}\left[\int e^{\int p(x)dx}q(x)\,dx+C\right]\,}\]

Example: for $y'+2xy=x$, $\mu=e^{x^2}$, and $\dfrac{d}{dx}[e^{x^2}y]=xe^{x^2}$ integrates to $y=\dfrac12+Ce^{-x^2}$ (verified by direct substitution: residual $0$).