Topics You Need To Understand For This Page
Differential Equations Alpha List
Tools
Related Topics and Links
Variation of Parameters 
\(\displaystyle{ y'' + p(t)y' + q(t)y = g(t) }\) 
classify  secondorder, linear, inhomogeneous 
Alternate Name For Variation of Parameters: Variation of Constants 
Variation of Parameters is a second order technique to solve nonhomogeneous differential equations. The form of the equations we solve using this technique is
\( y'' + p(t)y' + q(t)y = g(t) \) where \( g(t) \neq 0 \).
Although this technique will work when \( g(t) \) is a standard form, we normally use the method of undetermined coefficients which is easier. However, variation of parameters can be used for a wider range of problems.
The equations we use are
\(
W =
\begin{vmatrix}
y_1(t) & y_2(t) \\
y'_1(t) & y'_2(t)
\end{vmatrix}
\)

\(\displaystyle{
u'_1(t) = \frac{
\begin{vmatrix}
0 & y_2(t) \\
g(t) & y'_2(t)
\end{vmatrix}
}{W}
}\)

\(\displaystyle{
u'_2(t) = \frac{
\begin{vmatrix}
y_1(t) & 0 \\
y'_1(t) & g(t)
\end{vmatrix}
}{W}
}\)

\(y_1(t)\) and \(y_2(t)\) are solutions to the homogeneous equation 
The matrix \(W\) is called the Wronskian, and from the above equations you can tell that we require \(W \neq 0\). After evaluating the above matrices for \(u'_1(t)\) and \(u'_2(t)\), we integrate to obtain \(u_1(t)\) and \(u_2(t)\). The final solution to the differential equation is
\( y (t) = u_1(t) y_1 (t) + u_2(t) y_2 (t) \) 
It will help you understand these if you know where the equations come from. So the next panel shows the derivation of the these equations and explains stepbystep why we can use them in this form. If you prefer, just below the panel is a video explaining this same derivation.
Deriving the Variation of Parameters Equations
First, we form the homogeneous ( \(g(t)=0\) ) solution
\( y_H (t) = c_1 y_1 (t) + c_2 y_2 (t) \).
However, we replace the constants \( c_1, c_2\) with functions \( u_1 (t), u_2 (t) \). This gives us
\( y (t) = u_1(t) y_1 (t) + u_2(t) y_2 (t) \) [1]
Let's take the derivative with respect to \(t\).
\( y'(t) = u_1(t) y'_1(t) + \color{red}{u'_1(t)y_1(t)} + \) \( u_2(t) y'_2(t) + \color{red}{u'_2(t)y_2(t)} \)
Now we set up an unusual condition; we require
\( u'_1(t)y_1(t) + u'_2(t)y_2(t) = 0 \) 
i.e. we take the \(u\)derivative terms (red terms) and set the sum equal to zero. This removes those terms from the derivative \( y'(t) \) and we are left with
\( y'(t) = u_1(t) y'_1(t) + u_2(t) y'_2(t) \). Let's take the derivative of this again.
\( y''(t) = u_1(t) y''_1(t) + \color{red}{u'_1(t) y'_1(t)} + \) \( u_2(t) y''_2(t) + \color{red}{u'_2(t) y'_2(t)} \)
Now we set up another condition.
\( u'_1(t) y'_1(t) + u'_2(t) y'_2(t) = g(t) \) 
Again, we take the \(u\)derivatives terms (red terms) and set the sum equal to \( g(t) \) from the original differential equation.
Finally, we have the two equations
\(
\begin{array}{lclcl}
u'_1(t)y_1(t) & + & u'_2(t)y_2(t) & = & 0 \\
u'_1(t) y'_1(t) & + & u'_2(t) y'_2(t) & = & g(t)
\end{array}
\)
with the two unknowns \( u'_1(t), u'_2(t) \).
2. Solving For Two Unknowns 
Using Cramer's Rule to solve a system of equations, we have the Wronskian
\(
W =
\begin{vmatrix}
y_1(t) & y_2(t) \\
y'_1(t) & y'_2(t)
\end{vmatrix}
\)
which we use to solve for \( u'_1(t) \) and \( u'_2(t) \)
\(\displaystyle{
u'_1(t) = \frac{
\begin{vmatrix}
0 & y_2(t) \\
g(t) & y'_2(t)
\end{vmatrix}
}{W}
}\)


\(\displaystyle{
u'_2(t) = \frac{
\begin{vmatrix}
y_1(t) & 0 \\
y'_1(t) & g(t)
\end{vmatrix}
}{W}
}\)

Now we integrate the equations for \( u'_1(t)\) and \( u'_2(t) \) and plug the results into equation [1] to get our final answer. If we have initial conditions, we would need to use them to find the constants that result from the integration in the last step.
There are two ways to think about how to write the final solution. You can integrate \( u'_1(t)\) and \( u'_2(t) \) to get
\( u_1(t) + c_1\) and \( u_2(t) + c_2 \) and write the final solution as
\( y (t) = (u_1(t) + c_1) y_1 (t) + \) \( ( u_2(t) + c_2) y_2 (t) \)
or, as the video below shows, you can think of the solution \( y_p (t) = u_1(t) y_1 (t) + u_2(t) y_2 (t) \) as a particular solution to which you add the homogeneous solution to get
\( y (t) = y_p(t) + y_h(t) = \) \( u_1(t) y_1 (t) + u_2(t) y_2 (t) + \) \( c_1y_1(t) + c_2y_2(t) \)
As you can see, these are just two different ways of looking at the same thing. It is best to follow what your instructor requires.

Here is a video showing the same derivation. The presenter does a very good job explaining the equations.
 Dr Chris Tisdell  variation of parameters 

Here is another video discussing variation of parameters. This video is quite indepth and he starts out with some matrix theory that supports the later discussion. This video is included here for completeness but is not necessary for using variation of parameters.
 MIT OCW  variation of parameters 

Instructions   Unless otherwise instructed, solve these differential equations using the variation of parameters technique. Give your answers in exact terms and completely factored.
Practice A01 
\(y''5y'+6y=4e^t\) 


\(y(t)=2e^t+c_1e^{2t}+c_2e^{3t}\) 
We could use the method of undetermined coefficients to solve this problem more easily. However, we are asked to use variation of parameters. We will work through the solution by going through the derivation of the equations.
First, we solve the homogeneous equation \( y''5y'+6y = 0 \)
The characteristic equation is \( r^2  5r + 6 = 0 ~~~ \to ~~~ (r3)(r2) = 0 \).
So our homogeneous solution is \(\displaystyle{ y_H(t) = c_1e^{2t} + c_2e^{3t} }\)
Now, we work on the particular solution by replacing the constants with functions of t, \(\displaystyle{ y(t) = u_1(t)e^{2t} + u_2(t)e^{3t} }\), and taking the derivative with respect to t.
\(y'(t) = u_1(t)(2e^{2t}) + \color{red}{u'_1(t)e^{2t}} + \)
\( u_2(t)(3e^{3t}) + \color{red}{u'_2(t)e^{3t}}\)
For our first equation, we take the terms in red and set them equal to zero to get \( u'_1(t)e^{2t} + u'_2(t)e^{3t} = 0\) [ 1 ]
This leaves us with \(\displaystyle{ y'(t) = u_1(t)(2e^{2t}) + u_2(t)(3e^{3t}) }\), which we now take the derivative of with respect to t giving us
\( y''(t) = 2u_1(t)(2e^{2t}) + \color{red}{ 2u'_1(t)e^{2t} } + \)
\( 3u_2(t)(3e^{3t}) + \color{red}{ 3u'_2(t)e^{3t} } \)
Setting the red terms equal to \( g(t) = 4e^t \), we have
\(\displaystyle{ 2u'_1(t)e^{2t} + 3u'_2(t)e^{3t} = 4e^t}\)
Now, we have the two equations we need, the last one and equation [1].
\(\displaystyle{
\begin{array}{lclcl}
u'_1(t)e^{2t} & + & u'_2(t)e^{3t} & = & 0 \\
u'_1(t)(2e^{2t}) & + & u'_2(t)(3e^{3t}) & = & 4e^t
\end{array}
}\)
Now we need to solve for \( u'_1(t)\) and \( u'_2(t) \).
\(\displaystyle{
W =
\begin{vmatrix}
e^{2t} & e^{3t} \\
2e^{2t} & 3e^{3t}
\end{vmatrix}
= 3e^{5t}  2e^{5t} = e^{5t}
}\)
\(\displaystyle{
u'_1(t) = \frac{
\begin{vmatrix}
0 & e^{3t} \\
4e^t & 3e^{3t}
\end{vmatrix}
}{W}
= \frac{0 4e^{4t}}{e^{5t}} = 4e^{t} \to }\)
\(\displaystyle{ u_1(t) = \int{4e^{t} dt} = 4e^{t} + c_1 }\)
\(\displaystyle{
u'_2(t) = \frac{
\begin{vmatrix}
e^{2t} & 0 \\
2e^{2t} & 4e^t
\end{vmatrix}
}{W}
= \frac{4e^{3t}0}{e^{5t}} = 4e^{2t} \to }\)
\(\displaystyle{ u_2(t) = \int{4e^{2t} dt} = 2e^{2t} + c_2 }\)
Substituting these results into \(\displaystyle{ y(t) = u_1(t)e^{2t} + u_2e^{3t} }\) gives us
\(\displaystyle{
\begin{array}{rcl}
y(t) & = & [ 4e^{t} + c_1 ] e^{2t} + [ 2e^{2t} + c_2 ] e^{3t} \\
& = & 4e^t+ c_1 e^{2t}  2e^t + c_2 e^{3t} \\
& = & 2e^t + c_1 e^{2t} + c_2 e^{3t}
\end{array}
}\)
Practice A01 Final Answer 
\(y(t)=2e^t+c_1e^{2t}+c_2e^{3t}\) 
Practice A02 
\(y_1=x\) and \(y_2=x^3\) are solutions to the homogeneous equation, find the general solution of \(x^2y''3xy'+3y=4x^7\) 


\(y = x^7 / 6 + c_1x + c_2x^3\) 
Practice A02 Final Answer 
\(y = x^7 / 6 + c_1x + c_2x^3\) 
Practice B01 
\(\displaystyle{y''2y'+y=\frac{e^x}{x^2+1}}\) 


\(\displaystyle{y=Ae^x+Bxe^x\frac{e^x}{2}\ln(x^2+1)+xe^x\arctan(x)}\) 
Practice B01 Final Answer 
\(\displaystyle{y=Ae^x+Bxe^x\frac{e^x}{2}\ln(x^2+1)+xe^x\arctan(x)}\) 
Practice B02 
\(y''+y=\tan(x)\) 


\(y=\cos(x)\ln\abs{\sec(x)+\tan(x)}+A\cos(x)+B\sin(x)\) 
Practice B02 Final Answer 
\(y=\cos(x)\ln\abs{\sec(x)+\tan(x)}+A\cos(x)+B\sin(x)\) 
Practice B03 
\(y''+4y=\csc(2x)\) 


\(\displaystyle{y=A\cos(2x)+B\sin(2x)\frac{x}{2}\cos(2x)+\frac{1}{4}\sin(2x)\ln\abs{\sin(2x)}}\) 
Practice B03 Final Answer 
\(\displaystyle{y=A\cos(2x)+B\sin(2x)\frac{x}{2}\cos(2x)+\frac{1}{4}\sin(2x)\ln\abs{\sin(2x)}}\) 
Practice B04 
\(\displaystyle{y''+y=\frac{1}{\cos(x)}}\) 


\(y=A\cos(x)+B\sin(x)+\cos(x)\ln\abs{\cos(x)}+x\sin(x)\) 
Practice B04 Final Answer 
\(y=A\cos(x)+B\sin(x)+\cos(x)\ln\abs{\cos(x)}+x\sin(x)\) 
Practice B05 
\(\displaystyle{y''2y'+y=\frac{e^x}{x^4}}\) 


\(\displaystyle{y=c_1e^x+c_2xe^x+\frac{e^x}{6x^2}}\) 
Practice B05 Final Answer 
\(\displaystyle{y=c_1e^x+c_2xe^x+\frac{e^x}{6x^2}}\) 
Practice C01 
\(y''+9y=2\tan(3x)\) 


\(\displaystyle{y=\frac{2}{9}\cos(3x)\ln\abs{\sec(3x)+\tan(3x)}+A\cos(3x)+B\sin(3x)}\) 
Practice C01 Final Answer 
\(\displaystyle{y=\frac{2}{9}\cos(3x)\ln\abs{\sec(3x)+\tan(3x)}+A\cos(3x)+B\sin(3x)}\) 
Practice C02 
\(y''+3y'+2y=5\cos(t)\) 


\(y=Ae^{2x}\cos(x)+Be^{2x}\sin(x)xe^{2x}\cos(x)+e^{2x}\sin(x)\ln\abs{\sin(x)}\) 
Practice C02 Final Answer 
\(y=Ae^{2x}\cos(x)+Be^{2x}\sin(x)xe^{2x}\cos(x)+e^{2x}\sin(x)\ln\abs{\sin(x)}\) 