We consider a first-order linear ODE with constant coefficients.
The general solution of the first order linear ODE \[ \dfrac{\dd y}{\dd t}=p\cdot y+q\cdot t\] where \(p\) and \(q\) are constants with \(p\ne0\), is \[y(t)=c\cdot\e^{\,p\, t}-\frac{q}{p}\cdot t-\frac{q}{p^2}\] where \(c\) is a constant.
We first write the differential equation \[\frac{\dd y}{\dd t}=p\cdot y+q\cdot t\] in differential form: \[\dd y-p\cdot y\,\dd t=q\cdot t\,\dd t\] Multiplying both sides of the equation by \(e^{-p\, t}\) gives: \[e^{-p\, t}\,\dd y-p\cdot e^{-p\, t}\cdot y\,\dd t=q\cdot t\cdot e^{-p\, t}\,\dd t\] With the product rule for differentials we can simplify the left-hand side: \[\dd \left(e^{-p\, t}\cdot y\right)=q\cdot t\cdot e^{-p\, t}\,\dd t\] So: \[e^{-p\, t}\,y=\int q\cdot t\cdot e^{-p\, t}\,\dd t=q\cdot\int t\cdot e^{-p\, t}\,\dd t \] The integral on the right-hand side can be computed by means of partial integration: \[\begin{aligned} \int t\cdot e^{-p\, t}\,\dd t &=\int t\cdot\left(-\frac{1}{p}e^{-p\, t}\right)'\,\dd t\\ \\ &=t\cdot\left(-\frac{1}{p}\cdot e^{-p\, t}\right)-\int (t)'\cdot\left(-\frac{1}{p}\cdot e^{-p\, t}\right)\,\dd t\\ \\ &=-\frac{t}{p}\cdot e^{-p\, t}+\frac{1}{p}\cdot \int e^{-p\, t}\,\dd t\\ \\ &=-\frac{t}{p}\cdot e^{-p\, t}-\frac{1}{p^2}\cdot e^{-p\, t}+c\\ \end{aligned}\] for some constant \(c\). So, we can write the solution of the ODE as \[y=c\cdot e^{\,p\, t}-\frac{q}{p}\cdot t-\frac{q}{p^2}\] Note that the solution is equal to the sum of the specific solution \(\displaystyle y=-\frac{q}{r}\cdot t-\frac{q}{p^2}\) and the general solution \(y=c\cdot e^{\,p\, t}\) of the homogeneous equation \(\displaystyle\frac{\dd y}{\dd t}=p\cdot y.\)
If you have looked at the above, then you may have noticed that the differential equation was multiplied by a function that makes it possible to bring terms with \(\dd y\) and \(y\,\dd t\) under one differential. We will deal with the technique in greater detail.
In the proof of the theorm we first wrote the ODE in differential form and next multiplied all the terms by \(\e^{-p\, t}\). That factor enabled us to collect the terms with \(\dd y\) and \(y\,\dd t\) into one differential (that is, under one \(d\)-operator). Such a factor is an integrating factor.
In the case of a homogeneous first-order linear ODE \(y'=p(t)\cdot y\), the function \(\e^{-P(t)}\), where \(P(t)\) is an antiderivative of \(p(t)\), is an integrating factor.
In the case of a homogeneous first-order linear ODE \(y'=p(t)\cdot y\), the function \(\e^{-P(t)}\), where \(P(t)\) is an antiderivative of \(p(t)\), is an integrating factor: the differential form \[\dd y-p(t)\cdot y\,\dd t=0\] multiplied by this factor is \[\e^{-P(t)}\,\dd y-\e^{-P(t)}\cdot p(t)\cdot y\,d t = 0\] which can be rewritten as \[\dd\left(\e^{-P(t)}\cdot y\right) = 0\] Thus: \(\e^{-P(t)}\cdot y = c\), where \(c\) is an integration constant. So the general solution is \[ y = \e^{P(t)}\cdot C\]