Variation of Parameters |
Consider the linear nonhomogeneous second order ODE
\[y''+p(x)y'+q(x)y=g(x), \;\;\;\;(40)\]
where \(p(x),\;q(x)\), and \(g(x)\) are continuous functions. Note that if \(g(x)\) is not exponential, polynomial, sine or cosine functions, then the method of undetermined coefficients does not work. We will use a general method called variation of parameters} to find a particular solution of (40).
Theorem.
Suppose \(y_1\) and \(y_2\) are fundamental solutions of the corresponding homogeneous ODE of (40). Then a particular solution \(y_p\) of (40) is
\[y_p=-y_1\int\frac{y_2g}{W(y_1,y_2)}\, dx+y_2\int\frac{y_1g}{W(y_1,y_2)}\, dx.\]
Example.
Find the general solution of \(xy''-(x+1)y'+y=x^2e^x\).
You may use the fact that \(y_1=x+1\) and \(y_2=e^x\) are fundamental solutions of the corresponding homogeneous ODE.
Solution. Let's first put it in the standard form for variation of parameters:
\[y''-\left(1+\frac{1}{x}\right)y'+\frac{y}{x}=xe^x.\]
The homogeneous solution is \(y_h=c_1(x+1)+c_2e^x\).
\[W(y_1,y_2)=\,\begin{array}{|cc|}x+1& e^x\\1& e^x\end{array}=(x+1)e^x-e^x=xe^x.\]
By variation of parameters a particular solution is
\[\begin{align*}
y_p&=-y_1\int\frac{y_2g}{W(y_1,y_2)}\, dx+y_2\int\frac{y_1g}{W(y_1,y_2)}\, dx\\
&=-(x+1)\int\frac{e^xxe^x}{xe^x}\, dx+e^x\int\frac{(x+1)xe^x}{xe^x}\, dx\\
&=-(x+1)\int e^x\, dx+e^x\int (x+1)\, dx\\
&=-(x+1)e^x+e^x\left(\frac{x^2}{2}+x\right)\\
&=e^x \left(\frac{x^2}{2}-1\right).
\end{align*}\]
Thus the general solution is
\[y=c_1(x+1)+c_2e^x+e^x \left(\frac{x^2}{2}-1\right).\]
Example.
Find the general solution of \(y''+y=\tan x\).
Solution. The characteristic equation is \(r^2+1=0\implies r=\pm i\).
The homogeneous solution is \(y_h=c_1\cos x+c_2\sin x\).
\[W(y_1,y_2)=\,\begin{array}{|cc|}\cos x& \sin x\\-\sin x& \cos x\end{array}=\cos^2x+\sin^2 x=1.\]
By variation of parameters a particular solution is
\[\begin{align*}
y_p&=-y_1\int\frac{y_2g}{W(y_1,y_2)}\, dx+y_2\int\frac{y_1g}{W(y_1,y_2)}\, dx\\
&=-\cos x\int\frac{\sin x \tan x}{1}\, dx+\sin x\int\frac{\cos x \tan x}{1}\, dx\\
&=-\cos x\int\frac{\sin^2x}{\cos x}\, dx+\sin x\int\sin x\, dx\\
&=-\cos x\int\frac{1-\cos^2x}{\cos x}\, dx+\sin x(-\cos x)\\
&=-\cos x\int\left(\sec x-\cos x\right)\, dx-\sin x\cos x\\
&=-\cos x\left(\ln|\sec x+\tan x|-\sin x\right)-\sin x\cos x\\
&=-\cos x\ln|\sec x+\tan x|.
\end{align*}\]
Thus the general solution is \[y=c_1\cos x+c_2\sin x-\cos x\ln|\sec x+\tan x|.\]
Last edited