# Understanding linear differential equations and the method of integrating factors

Suppose we have a first-order linear differential equation of the form

$$\frac{dy}{dt}+ay=g(t) \tag 1$$

where $$a$$ is a given constant and $$g(t)$$ is a given function.

Because the coefficient of $$y'$$ is $$1$$, we have $$\mu(t)=e^{\int a dt}=e^{at}$$, which is the integrating factor.

When we multiply the diffeq. $$(1)$$ through by that integrating factor the LHS is the result of a product rule differentiation (i.e. it is the derivative with respect to $$t$$ of the integrating factor times $$y$$); that is,

$$e^{at}[\frac{dy}{dt}+ay]=\frac{d}{dt}[e^{at}y]$$

Thus $$\frac{d}{dt}[e^{at}y]=e^{at}g(t) \Rightarrow \int \frac{d}{dt}[e^{at}y] dt=\int e^{at}g(t)dt \Rightarrow e^{at}y=\int e^{at}g(t)dt$$

But my book says, "integrating both sides of the equation $$\frac{d}{dt} [e^{at}y]=e^{at}g(t)$$,

we find that $$e^{at}y=\int e^{at}g(t)dt+c \tag 2$$

where $$c$$ is an arbitrary constant". I'm not sure I understand this correctly, I know that the derivative and integral on the LHS cancel each other out, but where does the $$c$$ come from if we've not taken the antiderivative of the RHS?

And then the author says, "For many simple functions $$g(t)$$, we can evaluate the integral in equation $$(2)$$ and express the solution $$y$$ in terms of elementary functions. However, for more complicated functions $$g(t)$$, it is necessary to leave the solution in integral form. In this case

$$y=e^{-at}\int_{t_0}^te^{as}g(s)ds+ce^{-at} \tag 3$$

Note that in equation (3) we have used $$s$$ to denote the integration variable to distinguish it from the independent variable $$t$$, and we have chosen some convenient value $$t_0$$ as the lower limit of integration. The choice of $$t_0$$ determines the specific value of the constant $$c$$ but does not change the solution. For example, plugging $$=t_0$$ into the solution formula $$(3)$$ shows that $$c=y(t_0)e^{at_0}$$".

Can someone please explain how to reason through this problem?

• $\int f'(x)dx=f(x)+c$. They do not simply "cancel each other out"! Jan 26, 2022 at 8:46
• $\small \int \frac{d}{dt} [e^{at}y] = e^{at}y +c$ Jan 26, 2022 at 8:47
• I said that functions with same derivatives differ by a constant only to support the fact that "derivate and integral don't cancel out each other" as you happened to ask "why not". But if you want to see the analogy here then consider the functions, $f_1(t)= e^{at}y, \: f_2(t)=\int e^{at}g(t)dt$ and observe that $f_1$ and $f_2$ have same derivatives and so they differ by a constant as the book mentioned in eqn $(2)$. Jan 26, 2022 at 11:22
• You got that $\int \frac{d}{dt}[e^{at}y]dt=e^{at}y+k \Rightarrow ye^{at}=\int e^{at}g(t)dt-k$. Yeah, that's it. The book uses $+c$ instead of $-k$ as the constant of integration, which doesn't matter 'cause both represents arbitrary constant. "And because...." Yeah that's right too, more precisely, $c=-k+c_1$ where $c_1$ is the constant by which functions with same derivatives differ, isn't it? Jan 26, 2022 at 11:39
• @AmanKushwaha Got it :) That makes sense! Jan 26, 2022 at 11:46

Perhaps using (definite) integration, rather than antidifferentiation, will help you understand better. Notice that if $$\frac{\mathrm{d}}{\mathrm{d}t}e^{at}y(t)=e^{at}g(t),$$ then $$\int_{t_0}^t\frac{\mathrm{d}}{\mathrm{d}t'}e^{at'}y(t')\,\mathrm{d}t'=e^{at}y(t)-e^{at_0}y(t_0),$$ hence $$e^{at}y(t)=\int_{t_0}^te^{as}g(s)\,\mathrm{d}s+e^{at_0}y(t_0).$$ Now just let $$c=e^{at_0}y(t_0),$$ and you get the equation derived by the book.