Finding a Particular Solution Using the Method of Undetermined Coefficients

The Method of Undetermined Coefficients

This method provides a systematic way to determine a particular solution to a second-order nonhomogeneous differential equation of the form $$ ay'' + by' + cy = f(x) $$ by leveraging the structure of the nonhomogeneous term \( f(x) \).

When \( f(x) \) has a recognizable form, the particular solution \( y_p \) can often be assumed to have a similar structure. This makes it much easier to guess the appropriate form of the solution and determine its coefficients.

As a result, this method is a powerful and efficient tool for solving second-order differential equations with specific right-hand sides.

Why do we need a particular solution? Once we’ve found a particular solution \( y_p \), we can construct the general solution to the nonhomogeneous equation by adding it to the general solution \( y_o \) of the associated homogeneous equation: $$ y = y_o + y_p $$

Case 1: The Nonhomogeneous Term is a Polynomial

If \( f(x) \) is a polynomial \( P_n(x) \) of degree \( n \):

$$ ay'' + by' + cy = P_n(x) $$

then the particular solution \( y_p \) is assumed to be:

f(x) yp Conditions
Pn(x) A0 + A1x + A2x2 + ... + Anxn if \( c \ne 0 \)
Pn(x) x(A0 + A1x + A2x2 + ... + Anxn) if \( c = 0 \), \( b \ne 0 \)
Pn(x) x2(A0 + A1x + A2x2 + ... + Anxn) if \( c = 0 \), \( b = 0 \)

In practice, if the \( y \) term is missing (\( c = 0 \)), the particular solution must be of degree \( n+1 \). If both \( y \) and \( y' \) are missing (\( c = 0 \) and \( b = 0 \)), we increase the degree to \( n+2 \).

Example

Let’s determine a particular solution \( y_p \) for the following second-order nonhomogeneous equation:

$$ y'' + y = x^2 $$

We apply the method of undetermined coefficients.

Given: \( f(x) = x^2 \), with \( a = 1 \), \( b = 0 \), and \( c = 1 \).

Since \( f(x) \) is a degree-2 polynomial, and \( c \ne 0 \), we assume a solution of the form:

$$ y_p = A_0 + A_1 x + A_2 x^2 $$

Next, we compute its derivatives:

$$ y_p' = A_1 + 2A_2 x \qquad y_p'' = 2A_2 $$

We now substitute \( y_p \) and \( y_p'' \) into the differential equation:

$$ y'' + y = x^2 $$

$$ 2A_2 + (A_0 + A_1 x + A_2 x^2) = x^2 $$

Grouping like terms:

$$ x^2(A_2) + x(A_1) + (A_0 + 2A_2) = x^2 $$

We match coefficients on both sides:

$$ \begin{cases} A_2 = 1 \\ \\ A_1 = 0 \\ \\ A_0 + 2A_2 = 0 \end{cases} $$

Explanation. Matching powers of \( x \), we find: - From \( x^2 \): \( A_2 = 1 \) - From \( x \): \( A_1 = 0 \) - Constant term: \( A_0 + 2A_2 = 0 \) ⟹ \( A_0 = -2 \)

Simplifying:

$$ \begin{cases} A_2 = 1 \\ \\ A_1 = 0 \\ \\ A_0 = -2 \end{cases} $$

So the particular solution is:

$$ y_p = -2 + x^2 $$

Note. To find the general solution to the equation \( y'' + y = x^2 \), we combine the particular solution \( y_p = x^2 - 2 \) with the general solution of the homogeneous equation \( y_o = c_1 \cos(x) + c_2 \sin(x) \):

$$ y = y_o + y_p = c_1 \cos(x) + c_2 \sin(x) + x^2 - 2 $$

Case 2: The Nonhomogeneous Term is Exponential

If the nonhomogeneous term is an exponential function:

$$ ay'' + by' + cy = ke^{\lambda x} $$

then the particular solution \( y_p \) depends on the relationship between \( \lambda \) and the roots of the homogeneous characteristic equation:

f(x) yp Conditions
keλx A · eλx if \( \lambda \) is not a root of the characteristic equation \( ay^2 + by + c = 0 \)
keλx A · x · eλx if \( \lambda \) is a simple root
keλx A · xm · eλx if \( \lambda \) is a root of multiplicity \( m \)

For a full worked example, see the solution to \( y'' - 2y' - 3y = e^{4x} \).

When the Nonhomogeneous Term Is a Polynomial Times an Exponential

When the nonhomogeneous term \( f(x) \) is the product of a polynomial of degree \( n \) and an exponential function:

$$ ay'' + by' + cy = P_n(x) \cdot e^{\lambda x} $$

the particular solution \( y_p \) can be written in the following form:

f(x) yp Conditions
Pn(x)·eλx eλx·(A0 + A1x + A2x2 + ... + Anxn) if \( \lambda \) is not a root of the characteristic equation \( ay^2 + by + c = 0 \)
Pn(x)·eλx xm·eλx·(A0 + A1x + A2x2 + ... + Anxn) if \( \lambda \) is a root of multiplicity \( m \) of the characteristic equation

For a worked example, see the solution of \( y'' - 2y' + y = 6x e^x \).

When the Nonhomogeneous Term Is a Sine or Cosine Function

If \( f(x) \) is a linear combination of sine and cosine:

$$ ay'' + by' + cy = k_1 \sin(\lambda x) + k_2 \cos(\lambda x) $$

where one of the coefficients \( k_1 \) or \( k_2 \) may be zero:

$$ ay'' + by' + cy = k_1 \sin(\lambda x) \quad \text{if } k_2 = 0 $$

$$ ay'' + by' + cy = k_2 \cos(\lambda x) \quad \text{if } k_1 = 0 $$

then the particular solution takes the form:

f(x) yp Conditions
k1·sin(λx) + k2·cos(λx) A·sin(λx) + B·cos(λx) \( \lambda \) is fixed; A and B are undetermined constants
k1·sin(λx) + k2·cos(λx) x·[A·sin(λx) + B·cos(λx)] if \( b = 0 \) and \( i\lambda \) is a root of the characteristic equation

For a concrete example, refer to the solution of \( y'' + 4y' + 13y = \sin(3x) \).

Note. Even if the forcing term contains only sine or only cosine, the particular solution typically includes both sine and cosine terms.

When the Nonhomogeneous Term Is a Polynomial Times Sine or Cosine

If \( f(x) \) is the product of a polynomial and a sinusoidal function, possibly modulated by an exponential factor:

$$ ay'' + by' + cy = P_n(x) e^{\alpha x} \cos(\beta x) $$

$$ ay'' + by' + cy = P_n(x) e^{\alpha x} \sin(\beta x) $$

then the corresponding particular solution is:

f(x) yp Conditions
Pn(x)·eαx·cos(βx) (A0 + A1x + ... + Anxn)·eαx·cos(βx) + (B0 + B1x + ... + Bnxn)·eαx·sin(βx) if \( \alpha + i\beta \) is not a root of the characteristic equation
Pn(x)·eαx·sin(βx)
Pn(x)·eαx·cos(βx) x·(A0 + A1x + ... + Anxn)·eαx·cos(βx) + x·(B0 + B1x + ... + Bnxn)·eαx·sin(βx) if \( \alpha + i\beta \) is a root of the characteristic equation
Pn(x)·eαx·sin(βx)

For a detailed example, see the solution of \( y'' - y = 2x \sin(x) \).

Superposition Principle

If the nonhomogeneous term is the sum of two distinct functions:

$$ ay'' + by' + cy = f_1(x) + f_2(x) $$

then the particular solution is simply the sum of the particular solutions corresponding to each term:

$$ y_p = y_{p1} + y_{p2} $$

where \( y_{p1} \) and \( y_{p2} \) are particular solutions of:

$$ ay'' + by' + cy = f_1(x) $$

$$ ay'' + by' + cy = f_2(x) $$

For an illustrative example, see the solution of \( y'' + 3y = x + 2\cos(x) \).

And so on.

 

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Differential Equations

First-Order Differential Equations

Second-Order Differential Equations

Higher-Order Linear Equations

Examples and Practice Problems

Theory

Approximate Solutions