Skip to main content

Section 3.4 Variation of Parameters

Undetermined coefficients is an effective and relatively efficient way to solve for a particular non-homogeneous solution of a SOLCCDE. Its limitation is its scope: it only works for specific forcing terms. Variation of parameters is a much more general method of finding particular solutions. Its weakness is the reliance on difficult integrals — often I’ll have to leave the solutions in a form which involves unfinished integrals. In the examples, I’ll often stick to forcing terms which could have used undetermined coefficients, just to make the integrals reasonable.

Subsection 3.4.1 Wronskians

Definition 3.4.1.

Let \(f_1, f_2, \ldots f_n \in C^{n-1}(\RR)\text{.}\) The Wronskian of this set of functions is defined to be the determinant of a matrix involving the \(f_i\) and their derivatives.
\begin{equation*} W(f_1, f_2, \ldots, f_n) : = \left| \begin{matrix} f_1 \amp \ldots \amp f_n \\ f^\prime_1 \amp \ldots \amp f^\prime_n \\ f^{\prime\prime}_1 \amp \ldots \amp f^{\prime\prime}_n \\ \ldots \amp \ldots \amp \ldots \\ f^{(n-1)}_1 \amp \ldots \amp f^{(n-1)}_n \end{matrix} \right| \end{equation*}
The Wronskian of a set of functions is a check of their linear independence. The set of functions is linearly independent if and only if the Wronskisn is never zero. (That is, for no value of \(t\) is \(W(t) = 0\text{.}\)) Conveniently, if I know the functions are linearly independent, then their Wronskian can never be zero and I can divide by it without division by zero concerns.
For variation of parameters, I only need to the Wronskain of two functions. I’ll write this determinant explicitly for your convenience.
\begin{equation*} W(f_1,f_2) = \left| \begin{matrix} f_1 \amp f_2 \\ f_1^\prime \amp f_2^\prime \end{matrix} \right| = f_1 f_2^\prime - f_2 f_1^\prime \end{equation*}

Subsection 3.4.2 The Technique of Variations of Parameters

The general idea here follows the same idea as variation of parameters for first-order linear equations, described in Subsection 2.6.3. Let \(L\) be the second order operator
\begin{equation*} L = \frac{d^2}{dt^2} +P \frac{d}{dt} + Q\text{.} \end{equation*}
Let \(y_1\) and \(y_2\) be solutions to the homogeneous equation \(Ly=0\text{.}\) The general solution to the homogeneous equation is \(Ay_1 + By_2\text{.}\) The parameters are the constant \(A\) and \(B\text{.}\) To ‘vary the parameters’ is to replace the constants with functions. That is, I look for a solution which has the form
\begin{equation*} y_p = u_1 y_1 + u_2 y_2 \end{equation*}
where \(u_1(t)\) and \(u_2(t)\) are unknown functions instead of unknown constant. Then I put this form of \(y_p\) into the differential equation to try to determine what the unknown functions might be. A long and tedious calculation ensues. In this calculation, I calculate the derivative of \(y_p\text{,}\) put them in the differential equation, and then rearrange and group terms for the steps that will follow.
\begin{align*} y^\prime _p \amp = u_1^\prime y_1 + u_1 y_1^\prime + u_2^\prime y_2 + u_2 y_2^\prime \\ y^{\prime \prime}_p \amp = u_1^{\prime \prime} y_1 + 2 u_1^\prime y_1^\prime + u_1 y_1^{\prime \prime} + u_2^{\prime \prime} y_2 + 2 u_2^\prime y_2^\prime + u_2 y_2^{\prime \prime} \\ Ly_p \amp = u_1^{\prime \prime} y_1 + 2 u_1^\prime y_1^\prime + u_1 y_1^{\prime \prime} + u_2^{\prime \prime} y_2 + 2 u_2^\prime y_2^\prime + u_2 y_2^{\prime \prime} \\ \amp + P \left( u_1^\prime y_1 + u_1 y_1^\prime + u_2^\prime y_2 + u_2 y_2^\prime \right) Q \left( u_1 y_1 + u_2 y_2 \right) = f\\ \amp = u_1 \left( y_1^{\prime \prime} + Py_1^\prime + Q y_1 \right) + u_2 \left( y_2^{\prime \prime} + Py_2^\prime + Q y_2 \right) + (y_1 u_1^{\prime \prime} + u_1^\prime y_1^\prime) \\ \amp + (y_2 u_2^{\prime \prime} + u_2^\prime y_2^\prime) + P \left( y_1 u_1^\prime + y_2 u_2^\prime \right) + y_1^\prime u_1^\prime + y_2^\prime u_2^\prime = f \end{align*}
The first two terms in brackets are precisely the differential operators applied to the two homogeneous solutions. I can make that replacement. But, by definition, the homogeneous solutions are sent to zero by the differential operator, so both of those terms vanish.
\begin{align*} \amp = u_1 (L y_1) + u_2 (L y_2) + \frac{d}{dt} \left( y_1 u_1^\prime \right) + \frac{d}{dt} \left( y_2 u_2^\prime \right) \\ \amp + P \left( y_1 u_1^\prime + y_2 u_2^\prime \right) + \left( y_1^\prime u_1^\prime + y_2^\prime u_2^\prime \right) = f\\ \amp = 0 + 0 + \frac{d}{dt} \left(y_1 u_1^\prime + y_2 u_2^\prime \right) + P \left( y_1 u_1^\prime + y_2 u_2^\prime \right) + \left( y_1^\prime u_1^\prime + y_2^\prime u_2^\prime \right) = f \end{align*}
The result, so far, is still a complicated differential equations with three terms. I’m trying to determine the two functions \(u_1\) and \(u_2\text{,}\) but I simply don’t have enough information here. What to do? Well, one possible problem might be that the system is underdetermined. I took two entirely unknown functions, \(u_1\) and \(u_2\text{,}\) and only imposed on equation (the differential equation) on them. That might not have anywhere near a unique solution for both functions. If the system is underdetermined, I could try to solve the system by imposing another constraint. I could try any constraint, but I’d like to impose a constraint that makes the system easier to solve. There is a term that shows up twice, in brackets, in the previous equation. What if I simply impose the constraint that sets that term equal to zero: \(y_1 u_1^\prime + y_2 u_2^\prime = 0\text{.}\) This restriction removes two terms from the previous equation and leaves me with a much easier equation.
\begin{equation*} \left( y_1^\prime u_1^\prime + y_2^\prime u_2^\prime \right) = f \end{equation*}
Along with the restriction itself , I now have a linear system of two equations.
\begin{align*} y_1 u_1^\prime + y_2 u_2^\prime \amp = 0\\ y_1^\prime u_1^\prime + y_2^\prime u_2^\prime \amp = f \end{align*}
I can express this system as a matrix.
\begin{equation*} \left( \begin{matrix} 0 \\ f \end{matrix} \right) = \left( \begin{matrix} y_1 \amp y_2 \\ y_1^\prime \amp y_2^\prime \end{matrix} \right) \left( \begin{matrix} u_1^\prime \\ u_2^\prime \end{matrix} \right) \end{equation*}
Linear algebra then solves the system. Conveniently, the determinant of the system is the Wronskian \(W(y_1,y_2)\text{,}\) which I will simply write \(W\) for the remainder of this calculation.
\begin{align*} u_1^\prime \amp = \frac{-y_2 f}{W}\\ u_2^\prime \amp = \frac{y_1 f}{W} \end{align*}
The solution of the system of two equations only solves for the derivatives of \(u_1\) and \(u_2\text{.}\) To find the actual functions, I integrate.
\begin{align*} u_1 \amp = - \int \frac{y_2 f}{W} dt\\ u_2 \amp = \int \frac{y_1 f}{W} dt \end{align*}
I insert these \(u_i\) in the original expression.
\begin{equation*} y_p = \left( -\int \frac{y_2 f}{W} dt \right) y_1 + \left( \int \frac{y_1 f}{W} dt \right) y_2 \end{equation*}
Therefore, the general solution to the original equation \(Ly = f\) is
\begin{equation*} y_p = \left( -\int \frac{y_2 f}{W} dx \right) y_1 + \left( \int \frac{y_1 f}{W} dt \right) y_2 + Ay_1 + By_2\text{.} \end{equation*}
Conveniently, I don’t have to worry about constants of integration in either of the two integrals. If I had a constant of integration, it would lead to a multiple of one of the homogeneous solutions. Those multiples are already accounted for in the general homogeneous solution.

Example 3.4.2.

Here is a differential equation that could be solved by undetermined coefficients, since the forcing term is exponential. However, I’ll use variation of parameters to demonstrate.
\begin{equation*} y^{\prime\prime} - 2y^{\prime} + 2y = 2e^t \end{equation*}
First I solve the homogeneous equation by finding the roots of the characteristic equation.
\begin{equation*} r^2 -2r +2 = 0 \implies r = 1 \pm \imath \end{equation*}
The roots are complex with \(\alpha = 1\) and \(\beta = 1\text{.}\) Therefore, the solutions are products of exponentials and sinusoidal functions.
\begin{align*} y_1 \amp = e^t \cos t\\ y_2 \amp = e^t \sin t \end{align*}
Then I calculate the Wronskian of the two linearly independent homogeneous solutions.
\begin{align*} y_1^\prime \amp = e^t \cos t - e^t \sin t\\ y_2^\prime \amp = e^t \sin t + e^t \cos t\\ W \amp = e^t \cos t (e^t \sin t + e^t \cos t) - e^t \sin t (e^t \cos t - e^t \sin t)\\ \amp = e^{2t} (\cos t \sin t + \cos^2 t - \sin t \cos t + \sin^2 t) = e^{2t} \end{align*}
Once I have the Wronskian, I use the integral forms to calculate \(u_1\) and \(u_2\text{.}\) I don’t have to repeat the whole derivation from before; I can just use the general result.
\begin{align*} u_1 \amp = \int \frac{-y_2 f}{W} dt = -\int \frac{ e^t \sin t 2e^t}{e^{2t}}dt\\ \amp = -2 \int \sin t dt = 2 \cos t\\ u_2 \amp = \int \frac{y_1 f}{W} dt = \int \frac{ e^t \cos t 2e^t}{e^{2t}}dt\\ \amp = 2 \int \cos t dt = 2 \sin t \end{align*}
Then I can replace \(u_1\) and \(u_2\) in the expression for the particular solution.
\begin{equation*} y_p = 2\cos t e^t \cos t + 2 \sin t e^t \sin t = 2e^t \end{equation*}
(I made use of \(\sin^2 t + \cos^2 t = 1\) in the previous calculation). Finally, the full solution is the particular solution plus the homogeneous solution.
\begin{equation*} y = 2e^t + Ae^t \cos t + B e^t \sin t \end{equation*}

Example 3.4.3.

This differential equation that could be also solved by undetermined coefficients, since the forcing term is an exponential multiplied by a polynomial. However, again, I’ll use variation of parameters to demonstrate.
\begin{equation*} y^{\prime\prime} - 4y^{\prime} + 4y = (t+1)e^{2t} \end{equation*}
First I solve the homogeneous equation by finding the roots of the characteristic equation.
\begin{equation*} r^2 -4r +4 = 0 \implies r = 2 \end{equation*}
The root is real and repeated. Therefore, the solutions are exponential and exponential multiplied by \(t\text{.}\)
\begin{align*} y_1 \amp = e^{2t}\\ y_2 \amp = te^{2t} \end{align*}
Then I calculate the Wronskian of the two linearly independent homogeneous solutions.
\begin{align*} y_1^\prime \amp = 2e^{2t}\\ y_2^\prime \amp = 2te^{2t} + e^{2t}\\ W \amp = e^{2t} (e^{2t} + 2te^{2t}) - te^{2t} 2e^{2t} = e^{4t} \end{align*}
Once I have the Wronskian, I use the integral forms to calculate \(u_1\) and \(u_2\text{.}\) I don’t have to repeat the whole derivation from before; I can just use the general result.
\begin{align*} u_1 \amp = \int \frac{-y_2 f}{W} dt = -\int \frac{te^{2t}(t+1)e^{2t}}{e^{4t}} dt\\ \amp = - \int t^2 + t = \frac{-t^3}{3} - \frac{t^2}{2}\\ u_2 \amp = \int \frac{y_1 f}{W} dt = \int \frac{ e^{2t} (t+1)e^{2t}}{e^{4t}} dt\\ \amp = \int t+1 dt = \frac{t^2}{2} + t \end{align*}
Then I can replace \(u_1\) and \(u_2\) in the expression for the particular solution.
\begin{equation*} y_p = \left( \frac{-t^3}{3} - \frac{t^2}{2} \right) e^{2t} + \left( \frac{t^2}{2} + t \right) te^{2t} = \frac{t^3 e^{2t}}{6} + \frac{t^2e^2t}{2} \end{equation*}
Finally, the full solution is the particular solution plus the homogeneous solution.
\begin{equation*} y = \frac{t^3 e^{2t}}{6} + \frac{t^2e^2t}{2} + Ae^{2t} + Bte^{2t} \end{equation*}

Example 3.4.4.

This is (finally) an example that couldn’t have used undetermined coefficients.
\begin{equation*} y^{\prime\prime} + 9y = \csc 3t \end{equation*}
First I solve the homogeneous equation by finding the roots of the characteristic equation.
\begin{equation*} r^2 + 9 = 0 \implies r = \pm 3\imath \end{equation*}
The roots are complex, with \(\alpha = 0\) and \(\beta = 3\text{.}\) Therefore, the solutions are just sinusoidal functions. (There is no exponential growth or decay in amplitude since \(\alpha = 0\text{.}\)
\begin{align*} y_1 \amp = \cos 3t\\ y_2 \amp = \sin 3t \end{align*}
Then I calculate the Wronskian of the two linearly independent homogeneous solutions.
\begin{align*} y_1^\prime \amp = -3 \sin 3t\\ y_2^\prime \amp = 3 \cos 3t\\ W \amp = 3\cos^2 3t + 3 \sin^2 3t = 3 \end{align*}
Once I have the Wronskian, I use the integral forms to calculate \(u_1\) and \(u_2\text{.}\) I don’t have to repeat the whole derivation from before; I can just use the general result.
\begin{align*} u_1 \amp = \int \frac{-y_2 f}{W} dt = -\int \frac{\sin 3t \csc 3t}{3} dt = \frac{-1}{3} \int dt = \frac{-t}{3}\\ u_2 \amp = \int \frac{y_1 f}{W} dt = \int \frac{\cos3t \csc 3t}{3} dt = \frac{1}{3} \int \cot 3t = \frac{1}{9} \ln |\sin 3t| \end{align*}
Then I can replace \(u_1\) and \(u_2\) in the expression for the particular solution.
\begin{equation*} y_p = \frac{-t}{3} \cos 3t + \frac{\sin 3t \ln |\sin 3t|}{9} \end{equation*}
Finally, the full solution is the particular solution plus the homogeneous solution.
\begin{equation*} y = \frac{-t}{3} \cos 3t + \frac{\sin 3t \ln |\sin 3t|}{9} + A \cos 3t + B \sin 3t \end{equation*}
One of the reasons that undetermined coefficients wouldn’t have worked is that the form of the particular solution, \(\ln |\sin 3t|\text{,}\) is not a function likely to be guessed.

Example 3.4.5.

In this example, the resulting integrals are not expressable by elementary functions. In these cases, we just leave the integrals in the final solution. We just have to live with these unexpressible function (or, I suppose, come up with new names for them.)
\begin{equation*} y^{\prime\prime} - y = \frac{1}{t} \end{equation*}
First I solve the homogeneous equation by finding the roots of the characteristic equation.
\begin{equation*} r^2 - 1 = 0 \implies r = \pm 1 \end{equation*}
The roots are real. Therefore, the solutions are exponential functions.
\begin{align*} y_1 \amp = e^t\\ y_2 \amp = e^{-t} \end{align*}
Then I calculate the Wronskian of the two linearly independent homogeneous solutions.
\begin{align*} y_1^\prime \amp = e^t\\ y_2^\prime \amp = - e^{-t}\\ W \amp = -1 -1 = -2 \end{align*}
Once I have the Wronskian, I use the integral forms to calculate \(u_1\) and \(u_2\text{.}\) I don’t have to repeat the whole derivation from before; I can just use the general result.
\begin{align*} u_1 \amp = \int \frac{-y_2 f}{W} dt = -\int \frac{ e^{-t} \frac{1}{t}}{-2} = \frac{1}{2} \int \frac{e^{-t}}{t} dt\\ u_2 \amp = \int \frac{y_1 f}{W} dt = \int \frac{ e^t \frac{1}{t}}{-2} = \frac{-1}{2} \int \frac{e^t}{t} dt \end{align*}
Then I can replace \(u_1\) and \(u_2\) in the expression for the particular solution.
\begin{equation*} y_p = \frac{e^t}{2} \int \frac{e^{-t}}{t} dt - \frac{e^{-t}}{2} \int \frac{e^t}{t} dt \end{equation*}
Finally, the full solution is the particular solution plus the homogeneous solution.
\begin{equation*} y = \frac{e^t}{2} \int \frac{e^{-t}}{t} dt - \frac{e^{-t}}{2} \int \frac{e^t}{t} dt + Ae^t + Be^{-t} \end{equation*}