Skip to main content

Section 1.1 Variation of Parameters

Straight to the point....

Variation of Parameters tells us that the ODE \(p(t) y'' + q(t) y' + r(t)y = g(t)\) has a particular solution \(Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t)\text{,}\) where

\begin{gather*} Y(t) = \int_{t_0}^t \frac{y_1(s) y_2(t) - y_1(t) y_2(s)}{W[y_1,y_2](s)} \cdot \frac{g(s)}{p(s)} \ ds. \end{gather*}

Here, we take \(\{y_1, y_2\}\) to be a fundamental set of solutions of the homogeneous ODE \(p(t) y'' + q(t) y' + r(t)y = 0\text{,}\) that is to say, \(y_1 y_2' - y_1'y_2 \neq 0\text{.}\)

We also take \(t_0\) to be some number that lies in the range of \(t\) that the ODE is defined on. Choosing an appropriate \(t_0\) can sidestep a lot of the computational work.

Another way one can look at Variation of Parameters is that, given \(Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t)\text{,}\) the functions \(u_1\) and \(u_2\) satisfy the equation

\begin{align*} \begin{bmatrix} y_1 \amp y_2 \\ y_1' \amp y_2' \end{bmatrix} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} 0 \\ g(t)/p(t) \end{bmatrix}. \end{align*}

Memorizing this (or the process below) is certainly less meticulous than memorizing the direct integral form above. Notice that the \(2 \times 2\) matrix on the left hand side above is the matrix whose determinant equals the \(W[y_1,y_2](t)\text{.}\)

We are often interested in finding a particular solution of a nonhomogenous linear ODE \(p(t) y'' + q(t) y' + r(t)y = g(t)\text{,}\) mainly because the general solution of this ODE is

\begin{gather*} y(t) = h(t) + Y(t), \end{gather*}

where \(h(t)\) is the general solution of the homogeneous linear ODE \(p(t) y'' + q(t) y' + r(t)y = 0\) and \(Y(t)\) is any particular solution of the nonhomogeneous ODE \(p(t) y'' + q(t) y' + r(t)y = g(t)\text{.}\)

Using Variation of Parameters or Duhamel's Principle helps us find some particular solution \(Y(t)\) for the nonhomogeneous ODE. Here, we'll start with Variation of Parameters.

Subsection 1.1.1 Starting Variation of Parameters

Variation of Parameters begins by assuming that a particular solution \(Y(t)\) to

\begin{gather*} p(t) y'' + q(t) y' + r(t)y = g(t) \end{gather*}

is of the form

\begin{gather*} Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t). \end{gather*}

Here, \(y_1\) and \(y_2\) are fundamental solutions to the homogeneous ODE \(p(t) y'' + q(t) y' + r(t)y = 0\text{,}\) that is, the Wronskian \(W[y_1,y_2](t) \neq 0\) for all applicable \(t\text{.}\)

Let \(y_1, y_2\) be solutions of the homogeneous ODE \(p(t) y'' + q(t) y' + r(t)y = 0\text{.}\) Recall that the Wronskian of \(y_1, y_2\) is denoted \(W[y_1, y_2](t)\text{,}\) and

\begin{align*} W[y_1, y_2](t) = \det \begin{bmatrix} y_1(t) \amp y_2(t) \\ y_1'(t) \amp y_2'(t) \end{bmatrix} = y_1(t) y_2'(t) - y_1'(t) y_2(t). \end{align*}

The idea behind Variation of Parameters is to kind of "generalize" the general solution of the homogenous ODE. Note that if we have that \(u_1(t) = c_1\) and \(u_2(t) = c_2\) are constant for all \(t\text{,}\) then the solution \(Y(t) = c_1 y_1(t) + c_2 y_2(t)\) is actually a solution of the homogeneous ODE!

So, we generalize the homogeneous solution by \(Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t)\) in hopes that we find one (we only need one particular nonhomogeneous solution to describe them all!) solution to the nonhomogeneous ODE.

The algebra here can get a bit tricky, but I'll do my best to describe all the steps used!

Subsection 1.1.2 Equations involving \(u_1(t)\) and \(u_2(t)\)

Now, since \(Y(t)\) is a particular solution of \(p(t) y'' + q(t) y' + r(t)y = g(t)\text{,}\) we have that

\begin{equation} p(t) Y''(t) + q(t) Y'(t) + r(t)Y(t) = g(t).\label{eqn-varparam-Y}\tag{1.1.1} \end{equation}

We'll want to calculate \(Y'(t)\) and \(Y''(t)\text{,}\) using the form \(Y(t) = u_1(t) y_1(t) + u_2(t) y_2(t)\text{.}\) Doing so will create equations for \(u_1\) and \(u_2\text{,}\) which we will hopefully be able to solve.

First, calculate \(Y'(t)\text{:}\) (try it yourself! Remember that \(Y(t) = u_1 y_1 + u_2 y_2\text{,}\) all of those terms being functions of \(t\text{.}\))

We make good use of the product rule! Note that

\begin{align*} Y'(t) \amp = \Big[ u_1'(t) y_1(t) + u_2'(t) y_2(t) \Big] + u_1(t) y_1'(t) + u_2(t) y_2'(t). \end{align*}

We have 4 terms in our representation of \(Y'(t)\text{.}\) This means that \(Y''(t)\) will have 8 terms! To reduce down on the number of terms we have, we set

\begin{gather*} u_1'(t) y_1(t) + u_2'(t) y_2(t) = 0. \end{gather*}

This may seem arbitrary for now, but this will ease up a lot of our calculations. We now have that

\begin{align*} Y'(t) \amp = \Big[ u_1'(t) y_1(t) + u_2'(t) y_2(t) \Big] + u_1(t) y_1'(t) + u_2(t) y_2'(t) \\ \amp = u_1(t) y_1'(t) + u_2(t) y_2'(t). \end{align*}

Now, we calculate \(Y''(t)\text{,}\) using our representation of \(Y'(t)\) above.

Again, this should be another quick differentiation exercise.

\begin{gather*} Y''(t) = \Big[ u_1'(t) y_1'(t) + u_2'(t) y_2'(t) \Big] + u_1(t) y_1''(t) + u_2(t) y_2''(t). \end{gather*}

Now, we have expressions for \(Y'(t)\) and \(Y''(t)\text{.}\) Substitute these into (1.1.1) (Why isn't this working? This should expand out to show equation (1.1.1), will fix later). Doing so would yield that

\begin{gather*} u_1'(t) y_1'(t) + u_2'(t) y_2'(t) = \frac{g(t)}{p(t)}. \end{gather*}

Since \(y_1\) and \(y_2\) are solutions of the homogeneous equation, notice that

\begin{gather*} p(t) y_1''(t) + q(t) y_1'(t) + r(t )y_1(t) = 0, \end{gather*}

and

\begin{gather*} p(t) y_2''(t) + q(t) y_2'(t) + r(t )y_2(t) = 0. \end{gather*}

Now, we directly substitute \(Y'(t)\) and \(Y''(t)\) into (1.1.1):

\begin{align*} g(t) \amp = p(t) \Big[ u_1'(t) y_1'(t) + u_2'(t) y_2'(t) + u_1(t) y_1''(t) + u_2(t) y_2''(t) \Big] \\ \amp \quad + \ q(t) \Big[ u_1(t) y_1'(t) + u_2(t) y_2'(t) \Big] \\ \amp \quad + \ r(t) \Big[ u_1(t) y_1(t) + u_2(t) y_2(t) \Big], \\ \amp = u_1(t)\Big[ p(t) y_1''(t) + q(t) y_1'(t) + r(t )y_1(t) \Big] \\ \amp \quad + \ u_2(t) \Big[ p(t) y_2''(t) + q(t) y_2'(t) + r(t )y_2(t) \Big] \\ \amp \quad + \ p(t) \Big[ u_1'(t) y_1'(t) + u_2'(t) y_2'(t) \Big], \\ \amp = p(t) \Big[ u_1'(t) y_1'(t) + u_2'(t) y_2'(t) \Big]. \end{align*}

Finish off by dividing \(p(t)\) on both sides. Note that we must have that \(p(t) \neq 0\) for all \(t\) in the appropriate interval.

With this, we have finally found two equations involving \(u_1\) and \(u_2\text{,}\) which we can solve as a typical system of linear equations:
\begin{align*} u_1' y_1 + u_2' y_2 \amp = 0, \\ u_1' y_1' + u_2' y_2' \amp = \frac{g(t)}{p(t)}. \end{align*}

Subsection 1.1.3 Solving for \(u_1(t)\) and \(u_2(t)\)

We can write the two equations from the previous section as a matrix system.

\begin{align*} \begin{bmatrix} y_1 \amp y_2 \\ y_1' \amp y_2' \end{bmatrix} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} 0 \\ g(t) / p(t) \end{bmatrix} \end{align*}

With our knowledge from linear algebra, we can solve for \(u_1'\) and \(u_2'\) using matrix inverses:

\begin{align*} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} \amp = \begin{bmatrix} y_1 \amp y_2 \\ y_1' \amp y_2' \end{bmatrix}^{-1} \begin{bmatrix} 0 \\ g(t) / p(t) \end{bmatrix}\\ \amp = \frac{1}{y_1 y_2' - y_1' y_2} \begin{bmatrix} y_2' \amp -y_2 \\ -y_1' \amp y_1 \end{bmatrix} \begin{bmatrix} 0 \\ g(t) / p(t) \end{bmatrix}\\ \amp = \frac{g(t) / p(t)}{W[y_1, y_2](t)} \begin{bmatrix} -y_2 \\ y_1 \end{bmatrix} \end{align*}

At last! We have solved for \(u_1'(t)\) and \(u_2'(t)\text{:}\)

\begin{gather*} u_1'(t) = - \frac{y_2(t)}{W[y_1, y_2](t)} \frac{g(t)}{p(t)} \qquad \text{and} \qquad u_2'(t) = \frac{y_1(t)}{W[y_1, y_2](t)} \frac{g(t)}{p(t)}. \end{gather*}

We want \(u_1\) and \(u_2\text{.}\) We can choose \(t_0\) to be some number for which \(u_1(t_0) = 0\) and \(u_2(t_0) = 0\text{.}\)

When we perform "indefinite integrals" we always have to add a constant to our answer (that "\(+ C\)"). For example, we would write

\begin{gather*} \int x^2 \ dx = \frac{x^3}3 + C. \end{gather*}

In general, we have that

\begin{gather*} \int f'(x) \ dx = f(x) + C. \end{gather*}

That is to say, given \(f'(x)\text{,}\) we can find infinitely many unique \(f(x)\text{.}\) As in the case before, any function of the form \(x^3/3 + C\text{,}\) for any constant \(C\text{,}\) has the derivative \(x^2\)

All this is to say that we know what \(u_1'\) and \(u_2'\) are. But, we can find infinitely many unique \(u_1\) and \(u_2\) whose derivatives satisfy the forms we have. So we can shift \(u_1\) and \(u_2\) up or down until both intersect at some \(t_0\) with a value of \(0\text{.}\)

This helps us in that we can write that

\begin{gather*} u_1(t) = \int_{t_0}^t u_1'(s) \ ds = - \int_{t_0}^t \frac{y_2(s)}{W[y_1, y_2](s)} \frac{g(s)}{p(s)} \ ds, \end{gather*}

and

\begin{gather*} u_2(t) = \int_{t_0}^t u_2'(s) \ ds = \int_{t_0}^t \frac{y_1(s)}{W[y_1, y_2](s)} \frac{g(s)}{p(s)} \ ds. \end{gather*}

Subsection 1.1.4 Final Form of \(Y(t)\)

With all this, our final form of \(Y(t) = u_1y_1 + u_2y_2\) becomes

\begin{gather*} Y(t) = - y_1(t) \int_{t_0}^t \frac{y_2(s)}{W[y_1, y_2](s)} \frac{g(s)}{p(s)} \ ds + y_2(t) \int_{t_0}^t \frac{y_1(s)}{W[y_1, y_2](s)} \frac{g(s)}{p(s)} \ ds. \end{gather*}

All in one integral, this is expressed as

\begin{gather*} Y(t) = \int_{t_0}^t \frac{y_1(s) y_2(t) - y_1(t) y_2(s)}{W[y_1,y_2](s)} \cdot \frac{g(s)}{p(s)} \ ds. \end{gather*}

This is the particular solution we obtain with Variation of Parameters! It's certainly a handful to memorize, but starting with \(Y = u_1y_1 + u_2y_2\) and remembering the general steps we took along the way is another good way of remembering variation of parameters.

An interesting viewpoint of this is that we can write the general solution to a nonhomogeneous linear second order ODE of the form \(p(t) y'' + q(t) y' + r(t)y = g(t)\) using only a fundamental set of solutions \(\{y_1, y_2\}\) of the homogeneous ODE \(p(t) y'' + q(t) y' + r(t)y = 0\text{,}\) and a constant \(t_0\) that lies in the interval the ODE is defined on.

Namely, the general solution of \(p(t) y'' + q(t) y' + r(t)y = g(t)\) is

\begin{gather*} y(t) = c_1y_1(t) + c_2y_2(t) + \int_{t_0}^t \frac{y_1(s) y_2(t) - y_1(t) y_2(s)}{W[y_1,y_2](s)} \cdot \frac{g(s)}{p(s)} \ ds, \end{gather*}

where \(c_1,c_2\) are real constants.