6. Nonhomogeneous Linear Equations

Undetermined Coefficients

Undetermined Coefficients in Nonhomogeneous Linear Equations

students, in this lesson you will learn one of the most useful methods for solving certain nonhomogeneous linear differential equations. The big idea is simple: when the forcing term on the right-hand side has a familiar shape, we can guess a matching form for a particular solution and then determine the unknown constants by substitution. 🎯

What you will learn

  • Explain the main ideas and terminology behind the method of undetermined coefficients.
  • Recognize when the method can be used and when it cannot.
  • Build a good trial solution for common forcing terms.
  • Connect the method to the larger topic of nonhomogeneous linear equations.
  • Solve example problems step by step using evidence from the equation itself.

A nonhomogeneous linear differential equation has the form

$$a_n y^{(n)} + a_{n-1} y^{(n-1)} + \cdots + a_1 y' + a_0 y = g(x),$$

where $g(x)$ is not zero. The function $g(x)$ is called the forcing term or nonhomogeneous term. The method of undetermined coefficients helps find one particular solution $y_p$ to this equation. Then the full solution is

$$y = y_h + y_p,$$

where $y_h$ solves the associated homogeneous equation

$$a_n y^{(n)} + a_{n-1} y^{(n-1)} + \cdots + a_1 y' + a_0 y = 0.$$

Think of $y_h$ as the natural behavior of the system and $y_p$ as the response caused by outside forcing, like a spring being pushed by a periodic force or a circuit driven by a battery. βš™οΈ

The main idea behind the method

The method of undetermined coefficients works because certain forcing terms produce particular solutions with the same β€œfamily” of shapes. If the right-hand side is a polynomial, exponential, sine, cosine, or a product of these, then the particular solution often has a similar form.

The word undetermined means the coefficients are unknown at first. We choose a trial form with letters such as $A$, $B$, and $C$, then substitute into the differential equation. After matching coefficients of like terms, we solve for those unknown constants.

For example, suppose the equation is

$$y'' - 3y' + 2y = e^x.$$

Because the forcing term is $e^x$, we try a particular solution of the form

$$y_p = Ae^x.$$

Why this form? Because derivatives of $e^x$ are still multiples of $e^x$, so it stays in the same family. After substitution, we determine $A$.

This method is powerful because it can turn a differential equation into an algebra problem. That is a big reason it is so popular in introductory differential equations. πŸ“˜

When the method works and when it does not

students, the method of undetermined coefficients has an important limitation: it works best when the coefficients in the differential equation are constant and the forcing term is one of a special set of functions.

It is typically used for equations like

$$ay'' + by' + cy = g(x),$$

where $a$, $b$, and $c$ are constants. The forcing term $g(x)$ may be:

  • a polynomial such as $x^2 - 4x + 1$,
  • an exponential such as $e^{2x}$,
  • a sine or cosine such as $\sin x$ or $\cos 3x$,
  • or a product like $x e^x$, $e^x \cos x$, or $x^2 \sin x$.

It is usually not the best method for forcing terms such as $\ln x$, $\tan x$, or $e^{x^2}$. In those cases, other methods like variation of parameters may be needed.

So a good first step is to identify the form of $g(x)$. That tells you whether undetermined coefficients is a good tool to use. πŸ”

How to choose a trial solution

The trial solution must match the structure of the forcing term. Here are the most common patterns.

1. Polynomial forcing terms

If

$$g(x) = x^n,$$

then try a polynomial of the same degree:

$$y_p = A_n x^n + A_{n-1}x^{n-1} + \cdots + A_1 x + A_0.$$

For example, if

$$g(x) = 5x^2 - 3x + 7,$$

then try

$$y_p = Ax^2 + Bx + C.$$

2. Exponential forcing terms

If

$$g(x) = e^{ax},$$

then try

$$y_p = Ae^{ax}.$$

3. Sine and cosine forcing terms

If

$$g(x) = \sin bx \quad \text{or} \quad g(x) = \cos bx,$$

then try

$$y_p = A\cos bx + B\sin bx.$$

Even if only one of those appears on the right-hand side, both are included because derivatives of sine and cosine mix together.

4. Products of the basic types

If

$$g(x) = x^2 e^{3x},$$

try

$$y_p = (Ax^2 + Bx + C)e^{3x}.$$

If

$$g(x) = e^{2x}\cos 5x,$$

try

$$y_p = e^{2x}(A\cos 5x + B\sin 5x).$$

If the forcing term is a product of a polynomial and trig function, use a polynomial times both sine and cosine.

The resonance problem and the shortcut adjustment

Sometimes the trial solution overlaps with the homogeneous solution. This happens when the proposed form already appears in $y_h$. In that case, substitution would make the trial solution disappear or fail to produce new information.

This is called resonance or duplication. The fix is to multiply the trial solution by a power of $x$ until it becomes independent of the homogeneous solution.

Here is the rule:

  • If the trial solution is already part of $y_h$, multiply by $x$.
  • If it still overlaps after that, multiply by $x^2$.
  • Continue if needed.

Example: suppose

$$y'' - 2y' + y = e^x.$$

The homogeneous equation has characteristic equation

$$r^2 - 2r + 1 = 0,$$

so

$$r = 1$$

is a repeated root. Thus

$$y_h = (C_1 + C_2x)e^x.$$

A naive trial would be

$$y_p = Ae^x,$$

but that overlaps with $y_h$. Since $e^x$ already appears in the homogeneous solution, multiply by $x^2$:

$$y_p = Ax^2e^x.$$

This adjustment is essential for correctness. βœ…

Worked example: polynomial forcing

Solve

$$y'' - y = x.$$

First solve the homogeneous equation:

$$y'' - y = 0.

$$

The characteristic equation is

$$r^2 - 1 = 0,

$$

so

$$r = 1, -1.

$$

Thus

$$y_h = C_1e^x + C_2e^{-x}.$$

Now choose a particular solution. Because the forcing term is $x$, try

$$y_p = Ax + B.$$

Then

$$y_p' = A, \qquad y_p'' = 0.$$

Substitute into the differential equation:

$$0 - (Ax + B) = x.$$

So

$$-Ax - B = x.$$

Match coefficients:

$$-A = 1, \qquad -B = 0.$$

Therefore

$$A = -1, \qquad B = 0.$$

So

$$y_p = -x,$$

and the general solution is

$$y = C_1e^x + C_2e^{-x} - x.$$

This example shows the full process: identify the forcing term, guess a trial form, substitute, and match coefficients.

Worked example: exponential forcing with overlap

Solve

$$y'' - 3y' + 2y = e^x.$$

The homogeneous equation is

$$y'' - 3y' + 2y = 0,

$$

with characteristic equation

$$r^2 - 3r + 2 = 0.

$$

This factors as

$$(r - 1)(r - 2) = 0,

$$

so

$$y_h = C_1e^x + C_2e^{2x}.$$

Since the forcing term is $e^x$ and $e^x$ already appears in $y_h$, we multiply by $x$:

$$y_p = Axe^x.$$

Now compute derivatives:

$$y_p' = A e^x + Axe^x,$$

$$y_p'' = 2Ae^x + Axe^x.$$

Substitute:

$$(2Ae^x + Axe^x) - 3(Ae^x + Axe^x) + 2(Axe^x) = e^x.$$

Simplify:

$$2Ae^x + Axe^x - 3Ae^x - 3Axe^x + 2Axe^x = e^x,$$

which becomes

$$-Ae^x = e^x.$$

So

$$A = -1,$$

and

$$y_p = -xe^x.$$

The general solution is

$$y = C_1e^x + C_2e^{2x} - xe^x.$$

Why this method matters in the bigger picture

Undetermined coefficients is one part of the larger study of nonhomogeneous linear equations. It gives a direct way to build a particular solution when the forcing term is predictable. That makes it especially useful in modeling real systems.

For example:

  • A mass-spring system can be driven by a periodic force like $\sin t$.
  • A circuit can be driven by an input voltage like $e^{-t}$.
  • A mechanical system can experience a polynomial forcing such as a ramp function.

In each case, the differential equation describes how the system responds. The homogeneous solution gives the natural behavior, while the particular solution shows the effect of the external force.

The method also prepares you for more advanced techniques. When the forcing term is not suitable for a guessed trial solution, variation of parameters becomes a more general method. So undetermined coefficients is both a practical tool and a stepping stone in the broader topic. πŸš€

Conclusion

students, undetermined coefficients is a structured guessing method for finding a particular solution to certain nonhomogeneous linear differential equations. It works best when the forcing term is a polynomial, exponential, sine, cosine, or a product of these. The key steps are to identify the shape of $g(x)$, choose a matching trial solution, adjust for overlap with the homogeneous solution if needed, and then solve for the unknown coefficients by substitution.

Once you understand this method, you can solve many important differential equations more efficiently and see clearly how the forcing term shapes the system’s behavior.

Study Notes

  • A nonhomogeneous linear equation has the form $$a_n y^{(n)} + a_{n-1} y^{(n-1)} + \cdots + a_1 y' + a_0 y = g(x).$$
  • The general solution is $y = y_h + y_p,$ where $y_h$ solves the homogeneous equation and $y_p$ is a particular solution.
  • Undetermined coefficients works best when the coefficients in the equation are constant and $g(x)$ is a polynomial, exponential, sine, cosine, or a product of these.
  • The method uses a trial solution with unknown constants such as $A$, $B$, and $C$.
  • Derivatives of the trial solution are substituted into the differential equation, and coefficients are matched to solve for the unknowns.
  • If the trial solution duplicates a term in $y_h$, multiply by $x$, $x^2$, or higher powers of $x$ until it is independent.
  • Common trial forms include $Ax^n + \cdots + C,$ $Ae^{ax},$ $A\cos bx + B\sin bx,$ and products like $e^{ax}(A\cos bx + B\sin bx).$
  • The method is a key tool in studying nonhomogeneous linear equations and modeling forced systems in science and engineering.

Practice Quiz

5 questions to test your understanding

Undetermined Coefficients β€” Differential Equations | A-Warded