PAGE 1

5.5 Nonhomogeneous Eqs.: The Variation of Parameters

\[y'' + ay' + by = f(x) \rightarrow y = y_c + y_p\]

undetermined coeffs: \(y_p\) has same form as \(f(x)\)

  • limitations: \(y_p\) form must not change after differentiation (e.g. exponential remains exponential)
  • \(\rightarrow\) good w/ polynomials, exponentials and sine/cosine

but if \(f(x) = \tan x\), \(f'(x) = \sec^2 x\) changed form!

undetermined coeff cannot handle this

likewise, we can't use undetermined coeffs on \(\ln x\)

PAGE 2

today, we look at the variation of parameters

\[y'' + ay' + by = f(x)\]

\(y_c = c_1 y_1 + c_2 y_2\) where \(y_1\) and \(y_2\) form the complementary solution

the general solution, instead of \(y = y_c + y_p\), we express it as:

\(y = u_1(x)y_1 + u_2(x)y_2\)

"parameters"

goal: find \(u_1\) and \(u_2\).

Sub into \(y'' + ay' + by = f(x)\):

\[\begin{cases} y = u_1 y_1 + u_2 y_2 \\ y' = u_1 y_1' + u_1' y_1 + u_2 y_2' + u_2' y_2 \\ y' = u_1 y_1' + u_2 y_2' \\ y'' = u_1 y_1'' + u_1' y_1' + u_2 y_2'' + u_2' y_2' \end{cases}\]

we will set

\(u_1' y_1 + u_2' y_2 = 0\)

PAGE 3

Variation of Parameters: Derivation Continued

\[u_1 y_1'' + u_1' y_1' + u_2 y_2'' + u_2' y_2' + a u_1 y_1' + a u_2 y_2' + b u_1 y_1 + b u_2 y_2 = f(x)\]

Rearranging the terms to group by coefficients \(u_1\) and \(u_2\):

\[u_1 (y_1'' + a y_1' + b y_1) + u_2 (y_2'' + a y_2' + b y_2) + u_1' y_1' + u_2' y_2' = f(x)\]

Note on first term:

This term is 0 because \(y_1\) is part of \(y_c\). \(y_c\) is the solution to \(y'' + ay' + by = 0\).

Note on second term:

This term is 0 for the same reason.

After these terms vanish, we are left with:

\[u_1' y_1' + u_2' y_2' = f(x)\]

Together with the condition we set earlier: \(u_1' y_1 + u_2' y_2 = 0\).

System of Equations to Solve

\[\begin{cases} u_1' y_1 + u_2' y_2 = 0 \\ u_1' y_1' + u_2' y_2' = f(x) \end{cases}\]

Solve this system for \(u_1'\) and \(u_2'\), then integrate to find \(u_1\) and \(u_2\).

Then, the general solution is:

\[y = u_1 y_1 + u_2 y_2\]
PAGE 4

Example: Variation of Parameters

Example Problem

\[y'' - y' - 2y = 3e^{2x}\]

First, find the complementary solution \(y_c\):

\[y_c = c_1 e^{2x} + c_2 e^{-x}\]\[y_1 = e^{2x}, \quad y_2 = e^{-x}\]

If we were to use undetermined coefficients, we would need to set \(y_p = Axe^{2x}\) because there is an \(e^{2x}\) term already in \(y_c\).

Note: Variation of parameters does not require this adjustment.

Solving the System

We solve the following system for \(u_1'\) and \(u_2'\):

\[\begin{cases} u_1' y_1 + u_2' y_2 = 0 \\ u_1' y_1' + u_2' y_2' = 3e^{2x} \end{cases}\]

Representing the system in matrix form:

\[\begin{bmatrix} y_1 & y_2 \\ y_1' & y_2' \end{bmatrix} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} 0 \\ 3e^{2x} \end{bmatrix}\]

Setting up the augmented matrix with the specific functions:

\[\begin{bmatrix} y_1 & y_2 & 0 \\ y_1' & y_2' & 3e^{2x} \end{bmatrix} = \begin{bmatrix} e^{2x} & e^{-x} & 0 \\ 2e^{2x} & -e^{-x} & 3e^{2x} \end{bmatrix}\]
PAGE 5

Solving the System of Equations

\(-2R_1 + R_2 \rightarrow\)
\[ \begin{bmatrix} e^{2x} & e^{-x} & 0 \\ 0 & -3e^{-x} & 3e^{2x} \end{bmatrix} \]

Row 2:

\[ -3e^{-x} u_2' = 3e^{2x} \]\[ u_2' = -e^{3x} \]

Row 1:

\[ e^{2x} u_1' + e^{-x} u_2' = 0 \]\[ e^{2x} u_1' - e^{2x} = 0 \]\[ u_1' = 1 \]

Integrate:

\[ u_1 = \int 1 \, dx = x + c_1 \]\[ u_2 = \int -e^{3x} \, dx = -\frac{1}{3}e^{3x} + c_2 \]

General Solution:

\( y = u_1 y_1 + u_2 y_2 \)

PAGE 6
\[ y = (x + c_1) e^{2x} + \left( -\frac{1}{3}e^{3x} + c_2 \right) e^{-x} \]\[ y = c_1 e^{2x} + c_2 e^{-x} + x e^{2x} - \frac{1}{3} e^{2x} \]

Combine terms with \( e^{2x} \)

\[ y = c_1 e^{2x} + c_2 e^{-x} + x e^{2x} \]

\( y_c \)

(Complementary Solution)

\( y_p \)

(Particular Solution)

PAGE 7

Example: Variation of Parameters

Example

\( y'' + y = \sec x \)

Undetermined coefficients cannot handle this

First find \( y_c \):

\( r^2 + 1 = 0 \implies r = \pm i \)

\( y_c = C_1 \cos x + C_2 \sin x \)

\( y_1 = \cos x, \quad y_2 = \sin x \)

Solve for \( u_1' \) and \( u_2' \)

Set up the system of equations:

\[ u_1' y_1 + u_2' y_2 = 0 \]\[ u_1' y_1' + u_2' y_2' = f(x) \]

In matrix form:

\[ \begin{bmatrix} y_1 & y_2 \\ y_1' & y_2' \end{bmatrix} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} 0 \\ f(x) \end{bmatrix} \]

Substituting the specific functions for this problem:

\[ \underbrace{\begin{bmatrix} \cos x & \sin x \\ -\sin x & \cos x \end{bmatrix}}_{A} \underbrace{\begin{bmatrix} u_1' \\ u_2' \end{bmatrix}}_{\vec{x}} = \underbrace{\begin{bmatrix} 0 \\ \sec x \end{bmatrix}}_{\vec{b}} \]

\( \vec{x} = A^{-1} \vec{b} \)

PAGE 8
\[ \begin{bmatrix} \cos x & \sin x \\ -\sin x & \cos x \end{bmatrix} \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} 0 \\ \sec x \end{bmatrix} \]

Solving for the derivative vector by inverting the matrix:

\[ \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \frac{1}{\underbrace{\begin{vmatrix} \cos x & \sin x \\ -\sin x & \cos x \end{vmatrix}}_{\text{Wronskian of } y_1, y_2}} \underbrace{\begin{bmatrix} \cos x & -\sin x \\ \sin x & \cos x \end{bmatrix}}_{\text{inverse of } \begin{bmatrix} \cos x & \sin x \\ -\sin x & \cos x \end{bmatrix}} \begin{bmatrix} 0 \\ \sec x \end{bmatrix} \]

Integration

\[ \begin{bmatrix} u_1' \\ u_2' \end{bmatrix} = \begin{bmatrix} -\sin x \sec x \\ 1 \end{bmatrix} \]
\[ u_1 = \int -\sin x \cdot \frac{1}{\cos x} dx \]\[ u_1 = \ln |\cos x| + C_1 \]
\[ u_2 = \int 1 dx \]\[ u_2 = x + C_2 \]

General Solution

\( y = u_1 y_1 + u_2 y_2 \)

\[ y = \underbrace{C_1 \cos x + C_2 \sin x}_{y_c} + \underbrace{\cos x \ln |\cos x| + x \sin x}_{y_p} \]