TITLE: Why this equation is correct?
QUESTION [5 upvotes]: I am going through the University of Pennsylvania's numerical analysis lectures, which can be found here. I am a bit confused with equation 1.1.9 at page 6-7.
The equation is $y'(x) + a(x)y(x) = b(x)$. The notes say that this can be rewritten as 
$$a^{-A(x)}d(a^{A(x)}y(x)) = b(x)$$
 where $A(x)$ is an antiderivative of $a(x)$. So, we have that 
$$y'(x) + a(x)y(x) = a^{-A(x)}d(a^{A(x)}y(x)).$$
Why is that? I can not go from the first equation to the other.

REPLY [4 votes]: You have not transcribed the notes correctly. The notes say to consider 
$$y'(x) + a(x) y(x) = b(x)$$
Then we rewrite this equation in the equivalent form 
$$e^{-A(x)} \dfrac{d}{dx} \left( e^{A(x)} y(x) \right) = b(x)$$
Why is this correct? Because if we apply the derivative operator on the left hand side, we get 
$$e^{-A(x)} \left(A'(x) e^{A(x)} y(x) + e^{A(x)} y'(x)  \right) = A'(x)y(x) + y'(x) = b(x)$$
and recall $A'(x) = a(x)$.

REPLY [2 votes]: This is called an integrating factor. If we multiply the whole equation by $\exp\left(\int a(x)\,dx\right)$, we get
$$e^{\int a(x)\,dx}y'(x)+a(x)e^{\int a(x)\,dx}y(x) = b(x)e^{\int a(x)\,dx}.$$
Let's consider $\left(e^{\int a(x)\,dx}y(x)\right)'$. By product rule, we get
$$\left(e^{\int a(x)\,dx}\right)'y(x) + e^{\int a(x)\,dx}y'(x).$$
Moreover,
$$\left(e^{\int a(x)\,dx}\right)' = e^{\int a(x)\,dx}\left(\int a(x)\,dx\right)' = a(x)e^{\int a(x)\,dx}.$$
Thus we can realize $\left(e^{\int a(x)\,dx}y(x)\right)'$ as $a(x)e^{\int a(x)\,dx}y(x)+e^{\int a(x)\,dx}y'(x).$ So then our overall expression is
$$\left(e^{\int a(x)\,dx}y(x)\right)' = e^{\int a(x)\,dx}b(x).$$
Multiplying both sides by $e^{-\int a(x)\,dx}$ gives the result. See my answer here for a much more detailed exposition on this matter.

REPLY [2 votes]: This is deceptively anticlimactic, and in one phrase the answer is the product rule of differentiation, by which I mean that $(f(x)g(x))' = f'(x)g(x) + f(x)g'(x)$.

Claim:
$$e^{-A(x)}\frac{d}{dx} \left(e^{A(x)}y(x))\right) = y'(x) + a(x)y(x)$$

Proof: let's take the derivative on the left.
$$\frac{d}{dx} \left( d^{A(x)}y(x)\right) = e^{A(x)}a(x)y(x) + e^{A(x)}y'(x),$$
so that multiplying by $e^{-A(x)}$ gives exactly what we want. $\diamondsuit$
In terms of differential equations, this sort of method is usually called an integrating factor.