We begin by showing how to solve linear first-order ODEs with constant coefficients.
The general solution of the first order linear ODE \[ \dfrac{\dd y}{\dd t}+p\cdot y=q\cdot t\] in the unknown function #y# of #t#, where #p# and #q# are constants with #p\ne0#, is
\[y(t)=C\cdot\e^{-p\cdot t}+\frac{q}{p}\cdot t-\frac{q}{p^2}\]
Here, #C# is the integration constant.
We first write the differential equation in differential form: \[\dd y+p\cdot y\,\dd t=q\cdot t\,\dd t\] Multiplying this equality left and right by \(\e^{p\cdot t}\) gives: \[\e^{p\cdot t}\,\dd y+p\cdot\e^{p\cdot t}\,y\,\dd t=q\cdot t\cdot\e^{p\cdot t}\,\dd t\] By use of the product rule for differentials, the left side can be simplified: \[\dd\left(\e^{p\cdot t}\cdot y\right)=q\cdot t\cdot\e^{p\cdot t}\,\dd t\] Thus, \[\e^{p\cdot t}\cdot y=\int q\cdot t\cdot\e^{p\cdot t}\,\dd t=q\int t\cdot\e^{p\cdot t}\,\dd t \] The integral to the right can be calculated by means of Partial integration: \[\begin{array}{rcl}\displaystyle\int t\cdot\e^{p\cdot t}\,\dd t &=&\displaystyle\int t\cdot\frac{\dd}{\dd t}\left(\frac{1}{p}\e^{p\cdot t}\right)\,\dd t\\ \\ &=&\displaystyle\frac{t}{p}\e^{p\cdot t}-\int \frac{\dd}{\dd t}(t)\cdot \left(\frac{1}{p}\cdot\e^{p\cdot t}\right)\,\dd t\\ \\ &=&\displaystyle\frac{t}{p}\e^{p\cdot t}+\frac{1}{p}\int \e^{p\cdot t}\,\dd t\\ \\ &=&\dfrac{t}{p}\cdot\e^{p\cdot t}-\dfrac{1}{p^2}\cdot\e^{p\cdot t}+C\\ \end{array}\] for a certain constant \(C\). We conclude that the general solution of the ODE is \[y=C\cdot\e^{-p\cdot t}+\frac{q}{p}\cdot t-\frac{q}{p^2}\]
According to the theorem Linear structure of linear ODEs, the solution is equal to the sum of the particular (equilibrium) solution \(\displaystyle y=\frac{q}{p}\cdot t-\frac{q}{p^2}\) and the general solution \(y=C\cdot\e^{-p\cdot t}\) of the homogeneous ODE \(\displaystyle\frac{\dd y}{\dd t}+p\cdot y=0\). The expression behind the differential on the left side of the equation of the proof only depends on the homogeneous ODE.
If #p=0#, the general solution is the integral #y = \int q\cdot t\,\dd t = \frac{1}{2}q\cdot t^2+C#.
In the proof above, the differential equation is multiplied by a function that makes it possible to bring the terms with #y# and #\dd y# under one differential. We will deal with the technique in greater detail.
In the proof of the statement we first wrote the ODE in differential form and next multiplied all the terms by #\e^{p\cdot t}#. That factor enabled us to collect the terms with #{\dd y}# and #y\,\dd t# into one differential (that is, under one #\dd#). Such a factor is an integrating factor.
In the case of a homogeneous linear first order ODE #y'+p(t)\cdot y = 0#, the function #\e^{P(t)}#, where #P(t)# is an antiderivative of #p(t)#, is an integrating factor.
In the case of a homogeneous linear first order ODE #y'+p(t)\cdot y = 0#, the function #\e^{P(t)}#, where #P(t)# is an antiderivative of #p(t)#, is an integrating factor: the differential form multiplied by this factor is \[\e^{P(t)}\,\dd y+\e^{P(t)}\cdot p(t)\cdot y\,\dd t = 0\] which can be rewritten as
\[\dd \left(\e^{P(t)}\cdot y\right) = 0\]
Integration gives \(\e^{P(t)}\cdot y = C\), where #C# is an integration constant, so the general solution is:
\[ y = \e^{-P(t)}\cdot C\]
The product rule for differentials makes it possible to write a sum of differentials of the form #\dd y +p(t)\cdot y\,\dd t# as the single differential #\dd\left(\e^{P(t)}\cdot y\right) # after multiplication by the integrating factor #\e^{P(t)}#. Indeed:
\[\begin{array}{rcl}\dd\left(\e^{P(t)}\cdot y\right) &=&\e^{P(t)}\,\dd y+y\,\dd\e^{P(t)}\\ &=&\e^{P(t)}\,\dd y+\frac{\dd}{\dd t} \left(\e^{P(t)}\right) \cdot y\,\dd t\\ &=&\e^{P(t)}\,\dd y+p(t) \cdot \e^{P(t)} \cdot y\,\dd t\\ &=&\e^{P(t)} \cdot\left(\dd y+p(t) \cdot y\,\dd t\right)\end{array}\]
In the case of an inhomogeneous linear first-order ODE #y'+p(t)\cdot y = q(t)# the function #\e^{P(t)}#, where #P(t)# is an antiderivative of #p(t)#, is again an integrating factor. Once a particular solution #y_{\text{part}}# of the ODE has been found, the theorem Linear structure of linear ODEs gives that the general solution is equal to
\[y = \e^{-P(t)}\cdot C + y_{\text{part}}\]
Below are some examples.
The following homogeneous linear first-order ODE, where \(r\) is a constant distinct from #0#, represents exponential growth: \[\frac{\dd y}{\dd t}=r\cdot y\]
Specify the general solution of this equation.
\(y = C\cdot\e^{r\cdot t}\)
Previously, we solved this ODE by means of separation of variables.
The theorem
Solution of first-order linear ODE with constant coefficients gives that the solution is \[y(t)=C\cdot\e^{-p\cdot t}+\frac{q}{p}\cdot t-\frac{q}{p^2}\] where #p=-r# and #q=0#. This immediately leads to the answer \(y = C\cdot\e^{r\cdot t}\).
As a third alternative solution strategy, we show how to use an integrating factor in order to find the answer:
\[\begin{array}{rcl}\dd y-r\cdot y\,\dd t&=&0\\
&&\phantom{x}\color{blue}{\text{differential form}}\\
\e^{-r\cdot t }\dd y-\e^{-r\cdot t }\cdot r\cdot y\,\dd t&=&0\\
&&\phantom{x}\color{blue}{\text{differential form multiplied by integrating factor;}}\\
&&\phantom{x}\color{blue}{\text{this factor has the form }\e^{-r\cdot t}}\\
&&\phantom{x}\color{blue}{\text{since }{-r\cdot t}\text{ is an antiderivative of }-r}\\
&&\phantom{x}\color{blue}{\text{so the left side can be written as follows}}\\
\dd\left(\e^{-r\cdot t } \cdot y\right)&=&0\\
&&\phantom{x}\color{blue}{\text{differential form under a single differential}}\\
\e^{-r\cdot t }\cdot y&=&C\\
&&\phantom{x}\color{blue}{\text{differential form integrated with integration constant }C}\\
y&=&C\cdot\e^{r\cdot t } \\
&&\phantom{x}\color{blue}{\text{ solved for }y}\\
\end{array}\]