When the forcing function is built from polynomials, exponentials, sines, and cosines, its derivatives keep returning to the same short list of shapes. That makes it possible to guess the form of , leaving only some numerical coefficients to determine by substitution. The method is fast, but it has two firm limitations: constant coefficients only, and a restricted class of forcing functions.
Quick Reference
Trial functions. For each term of , take the corresponding trial form for :
| Trial function for | |
|---|---|
| , | |
| or | |
| or | |
| or |
The two rules.
- Modification Rule. If a term in your choice for also appears in , multiply every term in your choice by , or in general by the smallest integer power of such that contains no term also appearing in .
- Superposition Rule. If is a sum of terms from the first column, find a particular solution for each term separately and add them.
When the method does not apply. , , , , , and anything else with infinitely many independent derivatives. Use variation of parameters instead.
The Setting
We previously learned that the complete solution of a linear differential equation
L[y] = y^{(n)} + P_{n-1}(x)y^{(n-1)} + \cdots + P_1(x)y' + P_0(x)y = f(x) \tag{i}
can be written as
where is the general solution of the corresponding homogeneous equation, obtained by setting , and is any particular solution of (i).
In this section we introduce a method for finding . It is simple to use but has two major limitations.
Limitation 1. The method works only for linear differential equations with constant coefficients,
a_ny^{(n)} + \cdots + a_1y' + a_0y = f(x) \tag{ii}
with .
Limitation 2. The method applies only when the right-hand side of (ii) involves terms of the form (with ), , , , or products of two or more such functions.
More about the second limitation
The functions listed have only a finite number of linearly independent derivatives. That is the real content of the restriction.
For example, and its derivative f'(x) = k\cos kx are linearly independent, but the second derivative f''(x) = -k^{2}\sin kx is a multiple of the original function, and the third derivative is a multiple of the first. This function has only two linearly independent derivatives, itself and f'.
As a second example, consider , with f'(x) = e^{x} + xe^{x}. Then
\begin{aligned} f''(x) &= 2e^{x} + xe^{x} = 2f'(x) - f(x) \\ f'''(x) &= 3e^{x} + xe^{x} = 3f'(x) - 2f(x) \\ &\ \ \vdots \end{aligned}so every higher derivative is a combination of and f'. Again there are only two independent derivatives.
This method does not work for functions such as
These generate infinitely many linearly independent derivatives. For instance, successive differentiation of produces
f'(x) = -\frac{1}{x^{2}}, \quad f''(x) = \frac{2}{x^{3}}, \quad f'''(x) = -\frac{6}{x^{4}}, \quad \dotswith no repetition ever. A trial function with finitely many undetermined coefficients cannot possibly match such a forcing term.
The Method
To find the particular solution for (i), assume a trial function with a form similar to but containing some undetermined coefficients. Substitute this trial function into (ii), equate coefficients of like terms, and solve for the parameters.
The reason the guess succeeds is now visible: since and all its derivatives lie in the span of a finite list of functions, and merely differentiates and adds, a candidate drawn from that same span will produce in that span too. Matching coefficients then becomes a finite system of linear equations.
Why the polynomial case works, in detail
For simplicity consider a second-order equation
L[y] = ay'' + by' + cy = f(x) ,though the same argument applies at any order.
Case: .
We look for a such that when , y_p', and y_p'' are multiplied by constants and added, the result is a polynomial of degree . The obvious choice is a polynomial of degree with coefficients to be determined:
Computing,
\begin{aligned} L\left[y_p\right] &= a\left(2A_2 + \cdots + m(m-1)A_mx^{m-2}\right) \\ &\quad + b\left(A_1 + 2A_2x + \cdots + mA_mx^{m-1}\right) \\ &\quad + c\left(A_0 + A_1x + \cdots + A_mx^{m}\right) \end{aligned}Equating coefficients of like powers of in gives the triangular system
\left\{ \begin{aligned} cA_m &= b_m \\ cA_{m-1} + mbA_m &= b_{m-1} \\ &\ \ \vdots \\ cA_0 + bA_1 + 2aA_2 &= b_0 \end{aligned} \right.If , the first equation determines ; substituting into the second determines , and so on down the chain. So when the equation has a particular solution of the assumed form.
If the coefficients cannot be determined. Indeed, with the left side reduces to ay_p'' + by_p', which is a polynomial of degree when has degree , while has degree . To make the left side degree , choose a polynomial of degree for :
The constant term has been dropped, because already solves the homogeneous equation ay'' + by' = 0 and would contribute nothing. The coefficients are then uniquely determined provided .
If , the equation reduces to ay'' = f(x), solvable by direct integration, and takes the form
In summary,
y_p = \left\{ \begin{aligned} &A_0 + A_1x + \cdots + A_mx^{m} && \text{if } c \neq 0 \\ &x\left(A_0 + A_1x + \cdots + A_mx^{m}\right) && \text{if } c = 0 \text{ and } b \neq 0 \\ &x^{2}\left(A_0 + A_1x + \cdots + A_mx^{m}\right) && \text{if } b = c = 0 \end{aligned} \right.Notice that the three cases correspond exactly to being a non-root, a simple root, or a double root of the characteristic equation. That is precisely the Modification Rule at work.
The Two Rules
1. Modification Rule. If a term in your choice for also appears in , multiply every term in your choice by , or in general by the smallest integer power of such that contains no terms also appearing in .
The rule is necessary because a term already in satisfies , so it can never produce the nonzero right-hand side . Substituting it would give , an impossibility. Note the word every: if needs modification, it becomes , not .
2. Superposition Rule. If is a sum of two terms from the first column of the table, find a particular solution for each and add them.
In other words, if is a particular solution of and is a particular solution of , then is a particular solution of , because
Worked Examples
Find the general solution of
y'' - 3y' + 2y = 6x + 3e^{x} + \sin 2x .Solution
We know that , where is the general solution of y'' - 3y' + 2y = 0 and is any particular solution.
Step 1: find . The characteristic equation is
with roots and . Therefore
Step 2: split by the Superposition Rule. Write
where solves y'' - 3y' + 2y = 6x, solves y'' - 3y' + 2y = 3e^{x}, and solves y'' - 3y' + 2y = \sin 2x.
Step 3: the polynomial part. Set . Then
y_{p_1}' = B, \qquad y_{p_1}'' = 0 .Substituting,
Equating coefficients of and of ,
\left\{ \begin{aligned} 2B &= 6 && \text{coefficient of } x \\ 2A - 3B &= 0 && \text{coefficient of } 1 \end{aligned} \right.so and , giving
Step 4: the exponential part. Because appears in , the Modification Rule tells us to use
Differentiating,
\begin{aligned} y_{p_2}' &= Ce^{x} + Cxe^{x} \\ y_{p_2}'' &= 2Ce^{x} + Cxe^{x} \end{aligned}Substituting into the equation,
The terms in collect to and vanish, exactly as they must, since was not itself a homogeneous solution but was. What survives is
Therefore
Step 5: the trigonometric part. Set
Note that both a sine and a cosine must be included even though contains only a sine, because differentiation converts one into the other. The derivatives are
\begin{aligned} y_{p_3}' &= 2E\cos 2x - 2F\sin 2x \\ y_{p_3}'' &= -4E\sin 2x - 4F\cos 2x \end{aligned}Substituting,
Collecting,
that is,
Equating coefficients,
\left\{ \begin{aligned} -2E + 6F &= 1 \\ -6E - 2F &= 0 \end{aligned} \right.The second gives . Substituting into the first, , so and . Therefore
Step 6: assemble.
\begin{aligned} y_p &= y_{p_1} + y_{p_2} + y_{p_3} \\ &= 4.5 + 3x - 3xe^{x} - \frac{1}{20}\sin 2x + \frac{3}{20}\cos 2x \end{aligned}and the general solution is
Find the general solution of
y''' + y'' = 4x^{3} - 1 .Solution
Step 1: find . The characteristic equation is
The three linearly independent solutions of the homogeneous equation are
so
Step 2: choose the trial function. Because is a polynomial of degree , we start with . However, both and are solutions of the homogeneous equation, so by the Modification Rule we multiply by , the smallest power that clears the overlap:
Now no term in appears in : the lowest power present is .
Step 3: differentiate. Expanding, , so
\begin{aligned} y_p' &= 2A_0x + 3A_1x^{2} + 4A_2x^{3} + 5A_3x^{4} \\ y_p'' &= 2A_0 + 6A_1x + 12A_2x^{2} + 20A_3x^{3} \\ y_p''' &= 6A_1 + 24A_2x + 60A_3x^{2} \end{aligned}Step 4: substitute and match. Adding y_p''' + y_p'' and reorganizing by powers,
Equating coefficients of like powers,
\left\{ \begin{aligned} 20A_3 &= 4 \\ 12A_2 + 60A_3 &= 0 \\ 6A_1 + 24A_2 &= 0 \\ 2A_0 + 6A_1 &= -1 \end{aligned} \right.Solving from the top down: , then so , then so , then so .
Step 5: assemble.
and the complete solution is
Determine the correct form of (without computing the coefficients) for
y'' + 4y = 3\sin 2x + x e^{-x} .Solution
The characteristic equation gives , so
For the term , the usual trial function is . But both of these appear in , so the Modification Rule applies and the correct form is
For the term , the trial function is . Neither nor appears in , so no modification is needed.
By the Superposition Rule,
Note that the modification applied to the trigonometric part only. Each term of is examined against independently.
Exercises
Solve y'' - y = 3e^{2x}.
Solution
The characteristic equation gives . Since is not in , take . Then y_p'' - y_p = 4Ae^{2x} - Ae^{2x} = 3Ae^{2x} = 3e^{2x}, so .
Solve y'' + y = \cos x.
Solution
Here , and appears in , so the Modification Rule gives
Differentiating,
y_p' = A\cos x + B\sin x + x\left(-A\sin x + B\cos x\right)y_p'' = -2A\sin x + 2B\cos x + x\left(-A\cos x - B\sin x\right) = -2A\sin x + 2B\cos x - y_p .Therefore y_p'' + y_p = -2A\sin x + 2B\cos x = \cos x, giving and .
The unbounded factor is the signature of resonance: forcing an undamped oscillator at its own natural frequency produces an amplitude that grows without bound.
Solve y'' - 2y' + y = e^{x}.
Solution
The characteristic equation gives . The natural trial function is in ; so is . The smallest power of that clears both is :
Then y_p' = A\left(2x + x^{2}\right)e^{x} and y_p'' = A\left(2 + 4x + x^{2}\right)e^{x}, so
y_p'' - 2y_p' + y_p = A e^{x}\left[\left(2+4x+x^{2}\right) - 2\left(2x+x^{2}\right) + x^{2}\right] = 2Ae^{x} .Setting gives , so
Explain why undetermined coefficients cannot solve y'' + y = \tan x.
Solution
Because has infinitely many linearly independent derivatives. Successive differentiation gives , then , then , and so on, with new independent forms appearing at every stage. No trial function with finitely many undetermined coefficients can produce after substitution.
Use variation of parameters instead, which handles this case without difficulty.
Frequently Asked Questions
When can I use the method of undetermined coefficients?
Only when both conditions hold: the equation has constant coefficients, and is a polynomial, an exponential, a sine, a cosine, or a product of these. Either condition failing rules the method out.
What is the Modification Rule and why is it needed?
If a term of your trial already solves the homogeneous equation, substituting it gives , which cannot equal a nonzero . Multiplying the whole trial function by the smallest power of that removes the overlap fixes this. Multiply every term, not just the offending one.
Why include both sine and cosine when has only one of them?
Because differentiating a sine produces a cosine and vice versa. Substituting alone into an equation with a y' term generates a cosine that nothing can cancel, so the system becomes inconsistent. Always include both, and let the coefficients come out zero if one is not needed.
How do I know which power of to multiply by?
Use the smallest one that eliminates every overlap with . In practice this equals the multiplicity of the relevant root in the characteristic equation. If is a double root and contains , use .
What if has several different types of terms?
Use the Superposition Rule. Solve separately for each term , applying the Modification Rule independently to each piece, then add the results. Terms needing modification and terms not needing it can coexist happily in the same problem.
My system of equations for the coefficients has no solution. What went wrong?
Almost certainly a missed application of the Modification Rule. An inconsistent system is the telltale sign that part of your trial function solves the homogeneous equation. Compare each term of against and multiply through by as needed.
What is the connection to resonance?
When the forcing frequency matches a natural frequency of the system, contains a term already in , the Modification Rule kicks in, and the particular solution acquires a factor of . That factor grows without bound, which is precisely the physical phenomenon of resonance. The algebra and the physics are the same fact.