Variation of Parameters

The method of variation of parameters can be used to find the solution to non-homogeneous differential equations of any order, even if the coefficients aren’t constant, so long as the homogeneous solution can be found.

The Essentials

In order for the equation to be solved using the method of variation of parameters, the equation must fit in this form:

\[ y(n) + p(x)y^{(n-1)} + \ldots + g(x)y' + h(x)y = f(x) \]

Note that if the highest order term has a coefficient, then the whole equation would be divided by it. The first step is to find the homogeneous solution (null solution). After the homogeneous solution is known, a matrix is set up using the terms of the homogeneous solution and their derivatives. Here is an example of the matrix for a third order differential equation:

\[ \left[ \begin{array}{ccc} y_1 & y_2 & y_3 \\ y'_1 & y'_2 & y'_3 \\ y'' & y''_2 & y''_3 \end{array} \right] \]

A new vector is introduced where each component of the vector is a derivative. This vector is set equal to the inverse of the matrix multiplied by another vector whose components are all 0’s except for the last which is \( f(x) \). Here is an example for a third order equation:

\[ \left[ \begin{array}{c} u'_1 \\ u'_2 \\ u'_3 \end{array} \right] = \left[ \begin{array}{ccc} y_1 & y_2 & y_3 \\ y'_1 & y'_2 & y'_3 \\ y''_1 & y''_2 & y''_3 \end{array} \right]^{-1} \left[ \begin{array}{ccc} 0 \\ 0 \\ f(x) \end{array} \right] \]

From this expression equations are set up for each u′. The general solution will become: \( y(x) = u_1y_1 + u_2y_2 . . . + u_ny_n \)

Example

In the page for the method of undetermined coefficients, one of the practice problems is this one:

\[ y'' + 2y' + y = -x^2 \]

Here we are going to use the method of variation of parameters to find the solution. First, we find the homogeneous solution. After applying the method of constant coefficients we find that the homogeneous solution is \( y_h = C_1e^{−x} + C_2xe^{−x} \), but we will write it like this: \( y_1 = e^{−x}, y_2 = xe^{−x} \). Next, we write down our matrix:

\[ \left[ \begin{array}{cc} e^{-x} & xe^{-x} \\ -e^{-x} & e^{-x} - xe^{-x} \end{array} \right] \]

After taking the inverse and plugging it into the equation, we get:

\[ \left[ \begin{array}{c} u'_1 \\ u'_2 \end{array} \right] = e^{2x} \left[ \begin{array}{cc} e^{-x} - xe^{-x} & -xe^{-x} \\ e^{-x} & e^{-x} \end{array} \right] \left[ \begin{array}{c} 0 \\ -x^2 \end{array} \right] \] \[ u'_1 = x^3 e^x \] \[ u'_2 = -x^2 e^x \]

Using integration by parts we get:

\[ u_1 = e^x \left[ x^3 - 3x^2 + 6x - 6 \right] + C_1 \] \[ u_2 = e^x \left[ -x^2 + 2x - 2 \right] + C_2 \]

The general solution is:

\[ y(x) = u_1 y_1 + u_2 y_2 \] \[ y(x) = \left( e^x \left[x^3 - 3x^2 + 6x - 6 \right] + C_1 \right) e^{-x} + \left( e^x \left[ -x^2 + 2x - 2 \right] + C_2 \right) x e^{-x} \] \[ y(x) = x^3 - 3x^2 + 6x - 6 + C_1 e^{-x} - x^3 + 2x^2 - 2x + C_2 x e^{-x} \] \[ y(x) = C_1 e^{-x} + C_2 x e^{-x} - x^2 + 4x - 6 \]

Which is the same as the answer found using the method of undetermined coefficients.

Practice

Evaluate these expressions:

  1. \( x^2 y'' + xy' - y = x^2 \)
  2. \( x^3 y''' - x^2 y'' = 6x^2 \)

Solution:

  1. \( C_1x + C_2x^{-1} + \frac{1}{2}x \ln |x| - \frac{1}{4}x \)
  2. \( y(x) = C_1 + C_2 x + C_3 x^3 - 3x^2 \)