Differential equations: Solution methods for linear-second order ODEs
Variation of constants
We show how a particular solution can be found from a linear differential equation of second order if we have a pair of linearly independent solutions #y_1# and #y_2# of the corresponding homogeneous equation.
Variation of constants
Consider the differential equation \[y''+p(t)\cdot y'+q(t)\cdot y=g(t)\] in the unknown function #y# of #t#, where #p#, #q#, and #g# are continuous functions.
Suppose that #y_1# and #y_2# are solutions of the corresponding homogeneous equation with Wronskian #W# distinct from #0#. Let #c_1# and #c_2# be differentiable functions which are each determined, up a constant, by
\[\eqs{c_1'(t) &=& -\frac{1}{W(t)}\cdot y_2(t)\cdot g(t)\cr c_2'(t) &=& \frac{1}{W(t)}\cdot y_1(t)\cdot g(t)}\]
Then \[u(t) = c_1(t)\cdot y_1(t)+c_2(t)\cdot y_2(t)\]
is a particular solution of the original ODE.
The above method is called variation of constants.
The name variation of constants indicates that we replace the constants #c_1# and #c_2# of the solution #c_1\cdot y_1+c_2\cdot y_2# of the homogeneous equation by functions of #t# in order to find a particular solution.
The above method of finding a particular solution if the homogeneous solutions are known, always works, but it is cumbersome. Earlier we discussed the Ansatz method for quickly reaching a particular solution. Here too, it can be recommended in some common cases, to guess the nature of the functions #c_1# and #c_2#. We give a few examples.
\[y''+p\cdot y'+q\cdot y= g\]
with constant coefficients #p#, #q#, and #g# such that #q\ne0#?
We follow the variation of constants method to find the required solution. This solution has the form \[c_1(t)\cdot y_1(t)+c_2(t)\cdot y_2(t)\]
where #c_1# and #c_2# are each determined up to a constant by
\[\eqs{c_1'(t) &=& -\frac{1}{W(t)}\cdot y_2(t)\cdot g\cr c_2'(t) &=& \frac{1}{W(t)}\cdot y_1(t)\cdot g}\]
Here, #W# is the Wronskian.
Take the case where #D\gt0#. Then the characteristic equation two solutions, say #\lambda_1# and #\lambda_2#. These solutions satisfy the equations #\lambda_1+\lambda_2=-p# and #\lambda_1\cdot \lambda_2=q#. We can take as the basis solutions of the homogeneous equation: #y_1(t)=\e^{\lambda_1\cdot t}# and #y_2(t)=\e^{\lambda_2\cdot t}#. The Wronskian of this pair of differentiable functions is
\[W(t)= (\lambda_2-\lambda_1)\cdot \e^{(\lambda_1+\lambda_2)\cdot t}= (\lambda_2-\lambda_1)\cdot \e^{-p\cdot t}\]
We are ready to calculate the particular solution:
\[\begin{array}{rcl}
c_1'(t) &=&-\dfrac{1}{W(t)}\cdot y_2(t)\cdot g(t)\\
&=&-\dfrac{1}{\lambda_2-\lambda_1}\cdot\e^{p\cdot t}\cdot \e^{\lambda_2\cdot t}\cdot g\\
&&\phantom{x}\color{blue}{W(t) = (\lambda_2-\lambda_1)\cdot \e^{-p\cdot t}}\\
&=&-\dfrac{g}{\lambda_2-\lambda_1}\cdot\e^{-\lambda_1\cdot t}\\
&&\phantom{x}\color{blue}{\lambda_1+\lambda_2=-p}\\
&\text{and,}&\text{ likewise, }\\
c_2'(t)&=&\dfrac{1}{W(t)}\cdot y_1(t)\cdot g(t)\\&=&\dfrac{1}{\lambda_2-\lambda_1}\cdot\e^{p\cdot t}\cdot \e^{\lambda_1\cdot t}\cdot g\\&=&\dfrac{g}{\lambda_2-\lambda_1}\cdot\e^{-\lambda_2\cdot t}\end{array}\]
Because #g# is a constant, we find by integration,
\[\begin{array}{rcl}c_1(t)&=&\displaystyle-\frac{g}{\lambda_2-\lambda_1}\cdot\int \e^{-\lambda_1\cdot t}\,\dd t=\frac{g}{\lambda_1\cdot(\lambda_2-\lambda_1)}\cdot\e^{-\lambda_1\cdot t}\\
&\text{and}&\\
c_2(t)&=&\displaystyle\frac{g}{\lambda_2-\lambda_1}\cdot\int \e^{-\lambda_2\cdot t}\,\dd t=\frac{g}{-\lambda_2\cdot(\lambda_2-\lambda_1)}\cdot\e^{-\lambda_2\cdot t}\end{array}\]
The conclusion is
\[\begin{array}{rcl}y(t)&=&c_1(t)\cdot y_1(t)+c_2(t)\cdot y_2(t)\\ &=&\displaystyle \frac{g}{\lambda_1\cdot(\lambda_2-\lambda_1)}\cdot\e^{-\lambda_1\cdot t}\cdot\e^{\lambda_1\cdot t} +\frac{g}{-\lambda_2\cdot(\lambda_2-\lambda_1)}\cdot\e^{-\lambda_2\cdot t} \cdot\e^{\lambda_2\cdot t} \\
&=&\dfrac{g}{\lambda_2-\lambda_1}\cdot \left(\dfrac{1}{\lambda_1} -\dfrac{1}{\lambda_2}\right) \\
&=&\dfrac{g}{\lambda_2-\lambda_1}\cdot \dfrac{\lambda_2-\lambda_1}{\lambda_1\cdot\lambda_2} \\
&=&\dfrac{g}{q}\\
&&\phantom{x}\color{blue}{\lambda_1\cdot \lambda_2=q}
\end{array}\]
Verification for the other two cases ( #D=0# and #D\lt0# ) goes along the same lines.
Or visit omptest.org if jou are taking an OMPT exam.