The Method of Variation of Parameters

# The Method of Variation of Parameters

Recall from The Method of Undetermined Coefficients that we could solve a second order linear nonhomogeneous differential equation relatively easy provided that the function $g(t)$ was of the form of a polynomial, exponential function, or cosine/sine function. Unfortunately, the method of undetermined coefficients is much more difficult to apply when $g(t)$ is not of this form. Instead, The Method of Variation of Parameters is often times more suitable to use.

Consider a general second order linear nonhomogeneous differential equation whose coefficient functions $p$, $q$, and $g$ are continuous:

(1)
\begin{align} \quad \frac{d^2y}{dt^2} + p(t) \frac{dy}{dt} + q(t) y = g(t) \end{align}

The corresponding second order linear homogeneous differential equation is thus $\frac{d^2y}{dt^2} + p(t) \frac{dy}{dt} + q(t) y = 0$. Suppose that we know the general solution to the corresponding second order linear homogeneous differential equation in terms of two functions $y_1(t)$ and $y_2(t)$ which form a fundamental set of solutions to the corresponding second order linear homogeneous differential equation, say $y_h(t) = Cy_1(t) + Dy_2(t)$.

We will now replace the constants $C$ and $D$ with functions, $u_1(t)$ and $u_2(t)$ to get:

(2)
\begin{align} \quad Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t) \end{align}

We then want to try and determine what functions $u_1(t)$ and $u_2(t)$ make $Y(t) = u_1(t)y_1(t) + y_2(t)y_2(t)$ a particular solution to our original second order linear nonhomogeneous differential equation. We first differentiate $y$ and apply the product rule where appropriate to get:

(3)
\begin{align} \quad y' = u_1'(t)y_1(t) + u_1(t)y_1'(t) + u_2'(t)y_2(t) + u_2(t)y_2'(t) \end{align}

Now we will set the terms containing the derivatives of the functions $u_1'(t)$ and $u_2'(t)$ to equal zero, that is $u_1'(t)y_1(t) + u_2'(t)y_2(t) = 0$. Note that this is a rather hefty assumption, however, this assumption is not rash as we're looking only for a particular solution, namely one for which this property holds. We'll see that making this assumption does not lead to any contradictions, and so:

(4)
\begin{align} \quad y' = u_1(t)y_1'(t) + u_2(t)y_2'(t) \end{align}

We now differentiate again by applying the product rule where appropriate to get the second derivative of $y$:

(5)
\begin{align} \quad y'' = u_1'(t)y_1'(t) + u_1(t)y_1''(t) + u_2'(t)y_2'(t) + u_2(t)y_2''(t) \end{align}

We will now plug in $y$, $y'$, and $y''$ into our second order linear nonhomogeneous differential equation to get that:

(6)
\begin{align} \quad \frac{d^2y}{dt^2} + p(t) \frac{dy}{dt} + q(t)y = g(t) \\ \quad \left [ u_1'(t)y_1'(t) + u_1(t)y_1''(t) + u_2'(t)y_2'(t) + u_2(t)y_2''(t) \right ] + p(t) \left [ u_1(t)y_1'(t) + u_2(t)y_2'(t) \right ] + q(t) \left [ u_1(t) y_1(t) + u_2(t) y_2(t) \right ] = g(t) \\ \quad u_1(t) \underbrace{\left [ y_1''(t) + p(t)y_1'(t) + q(t)y_1(t) \right ]}_{=0} + u_2(t) \underbrace{\left [ y_2''(t) + p(t)y_2'(t) + q(t)y_2(t) \right ]}_{=0} + \left [ u_1'(t)y_1'(t) + u_2'(t)y_2'(t) \right ] = g(t) \\ \quad u_1'(t)y_1'(t) + u_2'(t)y_2'(t) = g(t) \end{align}

Now recall that we supposed that $u_1'(t)y_1(t) + u_2'(t)y_2(t) = 0$. To solve for $u_1'(t)$ and $u_2'(t)$, then all we need to do is solve the following system of equations:

(7)
\begin{align} 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{align}

Recall that a unique solution exists provided that the determinant $\begin{vmatrix} y_1(t) & y_2(t)\\ y_1'(t) & y_2'(t) \end{vmatrix}$ is nonzero. But this determinant is identically the Wronskian $W(y_1, y_2)$, and it is assumed that this Wronskian is nonzero since $y_1$ and $y_2$ form the general solution of the corresponding second order linear homogeneous differential equation, and so by apply Cramer's rule, the values of $u_1'(t)$ and $u_2'(t)$ are:

(8)
\begin{align} \quad u_1'(t) = \frac{\begin{vmatrix}0 & y_2(t)\\ g(t) & y_2'(t) \end{vmatrix}}{W(y_1, y_2)} = - \frac{y_2(t)g(t)}{W(y_1, y_2)} \quad , \quad u_2'(t) = \frac{\begin{vmatrix} y_1(t) & 0\\ y_1'(t) & g(t) \end{vmatrix}}{W(y_1, y_2)} = \frac{y_1(t)g(t)}{W(y_1, y_2)} \end{align}

We now integrate both sides of each equation above, and for constants $A$ and $B$, we get $u_1(t)$ and $u_2(t)$:

(9)
\begin{align} \quad u_1(t) = -\int \frac{y_2(t)g(t)}{W(y_1, y_2)} \: dt + A \quad , \quad u_2(t) = \int \frac{y_1(t)g(t)}{W(y_1, y_2)} \: dt + B \end{align}

Therefore, a particular solution to our second order linear nonhomogeneous differential equation is:

(10)
\begin{align} \quad Y(t) = u_1(t)y_1(t) + u_2(t)y_2(t) \\ \quad Y(t) = y_1(t) \left ( -\int \frac{y_2(t)g(t)}{W(y_1, y_2)} \: dt + A \right ) + y_2(t) \left ( \int \frac{y_1(t)g(t)}{W(y_1, y_2)} \: dt + B \right ) \\ \quad Y(t) = -y_1(t) \int \frac{y_2(t)g(t)}{W(y_1, y_2)} \: dt + y_2(t) \int \frac{y_1(t)g(t)}{W(y_1, y_2)} \: dt \: \underbrace{-Ay_1(t) + By_2(t)}_{=0} \\ \quad Y(t) = -y_1(t) \int \frac{y_2(t)g(t)}{W(y_1, y_2)} \: dt + y_2(t) \int \frac{y_1(t)g(t)}{W(y_1, y_2)} \: dt \end{align}

And finally, the general solution to our differential equation will be:

(11)
\begin{align} \quad y = Cy_1(t) + Dy_2(t) + Y(t) \\ \quad y = Cy_1(t) + Dy_2(t) -y_1(t) \int \frac{y_2(t)g(t)}{W(y_1, y_2)} \: dt + y_2(t) \int \frac{y_1(t)g(t)}{W(y_1, y_2)} \: dt \end{align}

Note that the method of variation of parameters is useful provided that the general solution to the corresponding second order linear homogeneous differential equation is easy to solve, and provided that the two integrals in the formula above are relatively simply to compute.