Undetermined Coefficients

For a non-homogeneous linear differential equation with constant coefficients, the constant coefficients method can be used to find the particular solution after the homogeneous solution is found.

The Essentials

Non-homogeneous linear equations with constant coefficients fit into this form:

\[ y^{(n)} + a_{n-1}y^{(n-1)} + \cdots + a_1 y' + a_0 y = g(x) \]

By looking at the forcing function \( g(x) \) the form of the solution can be guessed, with the constant coefficients remaining undetermined. The terms in the forcing function must be some linear combination of any of these terms multiplied together:

\[ x^n, \sin(kx), \cos(kx), e^{jx} \]

For each \( e^{kx} \) term, the particular solution will have a \( Ce^{kx} \) term. If there is a \( \sin(x) \) term or \( \cos(x) \) term the particular solution will have a \( C_1 \sin(x) \) term AND a \( C_2 \cos(x) \) term. Likewise, if there is a \( e^{jx} \sin(kx) \) term or a \( e^{jx} \cos(kx) \) term, the particular solution will have a \( C_1 e^{jx} \sin(x) \) term AND a \( C_2 e^{jx} \cos(x) \) term. If the forcing function has a polynomial term, the particular solution will have a polynomial term of the same order with unknown coefficients. Likewise, if there are other terms multiplied by a polynomial of order n, there needs to be n+1 terms of that kind multiplied by x for every term already written to make each one unique. For example if the forcing function contained \( x^2e^x \) then the particular solution would have:

\[ C_1 e^x + C_2 x e^x + C_3 x^2 e^x \]

And if the forcing function was \( x^2 sin(x) + x sin(x) \), then the particular solution would be:

\[ C_1 \sin(x) + C_2 \cos(x) + C_3 x \sin(x) + C_4 x \cos(x) + C_5 x^2 \sin(x) + C_6 x^2 \cos(x) \]

IMPORTANT: The homogeneous solution MUST be found first. If any terms in the particular solution match terms in the homogeneous solution, the terms that match in the particular solution must be multiplied by x until all the terms are unique. None of the terms in the homogeneous solution can match terms in the particular solution.

After the form for the particular solution is found, derivatives are taken and substituted into the original equation, the expression is simplified, and the unknown coefficients are found. After the coefficients are found the homogeneous solution and the particular solution are combined to get the general solution and then the initial conditions can be applied to find the constants from the homogeneous solution. Note that the initial conditions can only be applied after the homogeneous and particular solutions are combined.

Example

Solve the initial value equation:

\[ y''' - y' = 2x + 3e^x \] \[ y(0) = 6 \] \[ y'(0) = \frac{1}{2} \] \[ y''(0) = 6 \]

First, we need to find the homogeneous solution (null solution) of the equation. Using the method of constant coefficients we can find it:

\[ y_h = C_1 + C_2 e^x + C_3 e^{-x} \]

After that, we can look at the form of the forcing function. It has a polynomial of order 1 (2x), so the particular solution can have the term \( Ax+B \). However, the homogeneous solution already has a constant term, \( C_1 \), so we need to multiply the polynomial by x to get that part of the form of the particular solution:

\[ y_p = Ax^2 + Bx \]

To that we need to add a term to match the \( e^x \) term in the forcing function. Since there is already an \( e^x \) term in the homogeneous solution, we will multiply the one in the particular solution by x:

\[ y_p = Ax^2 + Bx + Cx e^x \]

Now that we have the form of the particular solution, we can differentiate to find the values of our undetermined coefficients:

\[ y_p = Ax^2 + Bx + Cx e^x \] \[ y'_p = 2Ax + B + C(xe^x + e^x) \] \[ y''_p = 2A + C(xe^x + e^x + e^x) \] \[ y'''_p = C(xe^x + e^x + e^x + e^x) \]

Plugging that into the original equation, we get:

\[ y''' - y' = 2x + 3e^x \] \[ C(xe^x + e^x + e^x + e^x) - (2Ax + B + C(xe^x + e^x)) = 2x + 3e^x \] \[ 2C e^x - 2Ax - B = 2x + 3e^x \]

Matching like terms on both sides, we can see that:

\[ A = -1, \quad B = 0, \quad C = \frac{3}{2} \]

Therefore, the particular solution is:

\[ y_p = -x^2 + \frac{3}{2} x e^x \]

The general solution is the homogeneous solution and the particular solution:

\[ y(x) = C_1 + C_2 e^x + C_3 e^{-x} - x^2 + \frac{3}{2} x e^x \]

Only after we have the general solution can we differentiate to find the initial conditions in the homogeneous solution:

\[ y'(x) = C_2 e^x - C_3 e^{-x} - 2x + \frac{3}{2} (xe^x + e^x) \] \[ y''(x) = C_2 e^x + C_3 e^{-x} - 2 + \frac{3}{2} (x e^x + 2e^x) \] \[ y(0) = 6 = C_1 + C_2 + C_3 \] \[ y'(0) = \frac{1}{2} = C_2 - C_3 + \frac{3}{2} \] \[ y''(0) = 6 = C_2 + C_3 - 2 + 3 \] \[ C_1 = 1 \] \[ C_2 = 2 \] \[ C_3 = 3 \] \[ y(x) = 1 + 2e^x + 3e^{-x} - x^2 + \frac{3}{2} x e^x \]

Example 2: Given the homogeneous solution, find the form of the particular solution.

\[ y(4) + 4y'(3) + 31y'' + 54y' + 26y = \textcolor{red}{xe^{-x}} + \textcolor{blue}{2x^2 e^{-x} \cos(5x)} - x^2 + 3x \] \[ y_h = C_1 e^{-x} + C_2 x e^{-x} + C_3 e^{-x} \sin(5x) + C_4 e^{-x} \cos(5x) \]

There is a \( \textcolor{red}{ xe^{−x} } \) term in the forcing function. This means that there have to be two of these exponential terms. Normally, they would be \( Ae^{−x} \) and \( Bx e^{-x} \), however both of these terms are in the homogeneous solution. We therefore have to multiply these by x until they are different than the terms in the homogeneous solution:

\[ y_p = Ax^2 e^{-x} + Bx^3 e^{-x} \]

For the \( \textcolor{blue}{ 2x^2 e^{-x} \cos(5x) }\) term, we need three terms because it is a second order polynomial and each of those needs to have both a sine and cosine term, that makes six total. However, since there is already a \( e^{-x} \sin(5x) \) term and a \( e^{-x} \cos(5x) \) term, we will have to multiply all six terms by x to make them unique:

\[ y_p = Ax^2 e^{-x} + Bx^3 e^{-x} + [C + Dx + Ex^2] e^{-x} \sin(5x) + [F + Gx + Hx^2] e^{-x} \cos(5x) \]

And for the final term, \( −x^2 + 3x \), we will add three terms, since it is a second order polynomial:

\[ y_p = Ax^2 e^{-x} + Bx^3 e^{-x} + [C + Dx + Ex^2] e^{-x} \sin(5x) + [F + Gx + Hx^2] e^{-x} \cos(5x) + Ix^2 + Jx + K \]

Practice

Solve the equations:

  1. \( y''' - 6y'' + 12y' - 8y = 6x e^{2x} + 6 e^{2x} \)
  2. \( y'' + y = \frac{1}{2} \cos(x) - 2 \)
  3. \( y'' + 2y' + y = -x^2 \)

Solution:

  1. \( y(x) = e^{2x}[C_1 + C_2 x + C_3 x^2 + x^3 - x^4] \)
  2. \( y(x) = C_1 \sin(x) + C_2 \cos(x) + \frac{1}{2} x \sin(x) - 2 \)
  3. \( y(x) = C_1 e^{-x} + C_2 x e^{-x} - x^2 + 4x - 6 \)