Skip to main content
Logo image

Section Undetermined Coefficients Method

In the last sections, we learned how to choose a form for the particular solution \(y_p\) by matching it to the forcing function \(f(x)\text{,}\) and how to modify \(y_p\) when it overlaps with the homogeneous solution \(y_h\text{.}\)
Now, we’ll finish the process by finding the exact values of the unknown coefficients in \(y_p\text{.}\) This final step is called the Method of Undetermined Coefficients, and it uses substitution and simplification to solve for the unknowns.

Subsection Determining the Coefficients

With \(y_p\) properly chosen and modified, the final step is to determine the values of the unknown coefficients. This step is purely algebraic: we plug \(y_p\) into the differential equation, simplify, and match coefficients to solve for the unknowns.
We will walk through this process using a concrete example. To solve
\begin{equation*} y'' - 2y' + y = 2x^2 + 3x \end{equation*}
we first find \(y_h\) by solving the homogeneous equation
\begin{equation*} y'' - 2y' + y = 0\text{.} \end{equation*}
The characteristic equation is
\begin{equation*} r^2 - 2r + 1 = 0, \end{equation*}
which factors as \((r - 1)^2 = 0\text{.}\) This gives a repeated root \(r = 1\text{,}\) so
\begin{equation*} y_h = c_1 e^x + c_2 x e^x. \end{equation*}
Now, pick \(y_p\) to match \(f(x) = 2x^2 + 3x\text{.}\) Since \(f(x)\) is a quadratic polynomial, we guess
\begin{equation*} y_p = A x^2 + B x + C. \end{equation*}
Since \(y_p\) has no terms in common with \(y_h\text{,}\) no modification is needed.
Substituting \(y_p\) and its derivatives,
\begin{equation*} y_p' = 2Ax + B,\quad y_p'' = 2A\text{,} \end{equation*}
into the equation and collecting like-terms gives
\begin{gather*} (2A) - 2(2Ax + B) + (Ax^2 + Bx + C) = 2x^2 + 3x \\ 2A - 4Ax - 2B + Ax^2 + Bx + C = 2x^2 + 3x \\ \us{\ds\text{1️⃣}}{\ul{A}}x^2 + \us{\ds\text{2️⃣}}{\ul{(-4A + B)}}x + \us{\ds\text{3️⃣}}{\ul{(2A - 2B + C)}} = \us{\ds\text{1️⃣}}{\ul{2}}x^2 + \us{\ds\text{2️⃣}}{\ul{3}}x + \us{\ds\text{3️⃣}}{\ul{0}} \text{.} \end{gather*}
Matching the underlined coefficients leads to the following system of equations and solution for \(A\text{,}\) \(B\text{,}\) and \(C\text{:}\)
\begin{align*} \amp\ \text{1️⃣}\ (x^2\ \text{terms}) \\ \amp\ \text{2️⃣}\ (x\ \text{terms}) \\ \amp\ \text{3️⃣}\ (\text{free terms}) \end{align*}
\begin{align*} A \amp = 2 \\ -4A + B \amp = 3 \\ 2A - 2B + C \amp = 0 \end{align*}
\begin{gather*} \rightarrow \\ \rightarrow \\ \rightarrow \end{gather*}
\begin{align*} \amp\ A = 2 \\ \amp\ B = 11 \\ \amp\ C = 18 \end{align*}
Therefore, \(y_p = 2x^2 + 11x + 18\) and we can now write the general solution as
\begin{equation*} y = y_h + y_p = c_1 e^x + c_2 x e^x + 2x^2 + 11x + 18\text{.} \end{equation*}
Assuming the forcing function is of the type found in TableΒ 159, this process should always lead to a single solution. If not, then double check your work and make sure the form of \(y_p\) was selected and modified correctly.

Checkpoint 172. πŸ“–β“ Not A Step in Finding \(y_p\).

Which of the following is NOT a step in finding the undetermined coefficients of the particular solution?
  • Applying the initial conditions.
  • Correct! The initial conditions are used to solve for the unknown constants in the general solution, not the particular solution.
  • Plugging \(y_p \) into the differential equation.
  • Incorrect. This is the first step in determining the coefficients.
  • Collecting and matching like-terms.
  • Incorrect. This is a crucial step for setting up the system of equations used to find the undetermined coefficients: \(A\text{,}\) \(B\text{,}\) ...
  • Solving a system of equations.
  • Incorrect. This is the final step in finding the coefficients.

Subsection Undetermined Coefficient Method Steps

Let’s summarize the entire process of using the Method of Undetermined Coefficients. Your goal is to find the full general solution \(y = y_h + y_p\) by first solving the homogeneous equation and then selecting, modifying, and finding \(y_p\text{.}\)

✍🏻 Method 5. Undetermined Coefficients.

The general solution for the linear nonhomogeneous constant coefficient equation,
\begin{equation} a_n y^{(n)} + a_{n-1} y^{(n-1)} + \dots + a_1 y' + a_0 y = f(x)\text{,}\tag{42} \end{equation}
is determined from the following steps:
Step 1: Solve the homogeneous equation to get \(y_h\)
Find the homogeneous solution \(y_h\) by solving the characteristic equation from
\begin{equation*} a_n y^{(n)} + a_{n-1} y^{(n-1)} + \cdots + a_1 y' + a_0 y = 0\text{.} \end{equation*}
Step 2: Select the form of \(y_p\)
Use TableΒ 159 to select a starting form for \(y_p\) based on \(f(x)\text{.}\) The constants \(A\text{,}\) \(B\text{,}\) \(C\text{,}\) ... are the undetermined coefficients.
Step 3: Modify \(y_p\) if it conflicts with \(y_h\)
Check \(y_p\) for conflicting terms already in \(y_h\text{.}\) If present, multiply these terms by \(x\text{.}\) Repeat until no terms are shared.
Step 4: Find the Undetermined Coefficients of \(y_p\)
Substitute \(y_p\) and its derivatives into (42). Simplify and match coefficients of like terms to set up a system of equations. Solving this system gives the coefficients, \(A\text{,}\) \(B\text{,}\) \(C\text{,}\) ....
Step 5: Give the Solution
Write the general solution as
\begin{equation*} y = y_h + y_p. \end{equation*}
and apply any initial conditions, if given.
You’ll follow these same five steps for any forcing function that fits the method. Now let’s apply this process to some worked examples to see how it all comes together.

Checkpoint 173.

(a) πŸ“–β“ Not A Step in the Undetermined Coefficient Method.
What are the main steps for finding \(y_p\) using the method of undetermined coefficients?
  • Select a \(y_p\) form ➜ modify it, if necessary ➜ find its coefficients.
  • Correct! The process involves making an educated guess, substituting it, and solving for unknown coefficients.
  • Select a \(y_p\) form ➜ integrate it ➜ find its coefficients.
  • Incorrect. Integration is not a part of the method of undetermined coefficients.
  • Select a \(y_p\) form ➜ find its coefficients ➜ differentiate it.
  • Incorrect. The focus is on selecting and solving for \(y_p\text{,}\) not guessing the homogeneous solution.
  • Select a \(y_p\) form ➜ differentiate it ➜ verify the solution.
  • Incorrect. Integration is not a step in this method; it’s about solving for coefficients of \(y_p\text{.}\)
(b) πŸ“–β“ Final Step of the Method.
In the final step of the method, after substituting \(y_p\) and simplifying, what do you do next?
  • Graph \(y_h\) and \(y_p\) to verify behavior.
  • Use initial conditions to determine integration constants.
  • Match coefficients of like terms and solve for unknown constants in \(y_p\text{.}\)
  • Integrate \(y_p\) to eliminate forcing terms.

Subsection Worked Examples

Apply the method of undetermined coefficients to find the general solution of the following linear nonhomogeneous differential equations.

🌌 Example 174. First-Order LNCC with an Initial Condition.

Find the general solution of
\begin{equation*} y' - 3y = 9x^2 + x, \quad y(0) = 5 \end{equation*}
Solution.
characteristic equation:
\(\ds r - 3 = 0 \quad\Rightarrow\quad r = 3 \)
homogeneous solution:
\(\ds y_h = c_1 e^{3x} \)
initial \(y_p\text{:}\)
\(\ds y_p = A x^2 + B x + C \)
compute \(y_p'\text{:}\)
\(y_p' = 2A x + B \)
substitute \(y_p\text{,}\) \(y_p'\text{:}\)
\((2A x + B) - 3 (A x^2 + B x + C) = 9x^2 + x \)
group powers of \(x\text{:}\)
\((-3A)\ x^2 + (2A - 3B)\ x + (B - 3C) = 9x^2 + x \)
Match coefficients:
\begin{align*} -3A \amp = 9 \\ 2A - 3B \amp = 1 \\ B - 3C \amp = 0 \end{align*}
\begin{gather*} \Rightarrow \\ \Rightarrow \\ \Rightarrow \end{gather*}
\begin{align*} A = -3 \amp \\ 2(-3)-3B \amp = -2 \\ -\sfrac34 - 3C \amp = 0 \end{align*}
\begin{gather*} \\ \Rightarrow \\ \Rightarrow \end{gather*}
\begin{align*} \\ B \amp = -\sfrac{3}{4} \\ C \amp = -\sfrac{1}{4} \end{align*}
particular solution:
\(\ds y_p = -3 x^2 - \frac34 x - \frac14 \)
general solution:
\(\ds y = c_1 e^{3x} - 3 x^2 - \frac34 x - \frac14 \)
apply \(y(0) = 5\text{:}\)
\(\ds 5 = y(0) = c_1 - \frac14 \quad\Rightarrow c_1 = \frac{21}{4} \)
final solution:
\(\ds y = \frac{21}{4} e^{3x} - 3 x^2 - \frac34 x - \frac14 \)

🌌 Example 175. Exponential Forcing Function.

Find the general solution of
\begin{equation*} y'' - 3y' + 2y = 5e^{2x} \end{equation*}
Solution.
characteristic equation:
\begin{align*} r^2 - 3r + 2 = 0 \amp\quad\Rightarrow\quad (r - 1)(r - 2) = 0 \\ \amp\quad\Rightarrow\quad r = 1, 2 \end{align*}
homogeneous solution:
\(\ds y_h = c_1 e^x + c_2 e^{2x} \)
initial \(y_p\text{:}\)
\(\ds y_p = A e^{2x} \)
Since \(Ae^{2x}\) and \(c_2e^{2x}\) are like terms, we modify \(y_p\text{:}\)
modified \(y_p\text{:}\)
\(\ds y_p = Axe^{2x} \)
compute \(y_p'\text{,}\) \(y_p''\text{:}\)
\begin{align*} y_p' \amp = A e^{2x} + 2Ax e^{2x}\\ y_p'' \amp = 2A e^{2x} + 2A e^{2x} + 4Ax e^{2x} = 4A e^{2x} + 4Ax e^{2x} \end{align*}
substitute \(y_p\text{,}\) \(y_p'\text{,}\) \(y_p''\text{:}\)
\begin{equation*} (4A e^{2x} + 4Ax e^{2x}) - 3(A e^{2x} + 2Ax e^{2x}) + 2(A x e^{2x}) = 5e^{2x} \end{equation*}
group like terms:
\begin{gather*} \ub{(2A - 3A + 2A)}_{\ds = A} e^{2x} + \ub{(4A - 6A + 2A)}_{\ds = 0} x e^{2x} = 5e^{2x}\\ A e^{2x} = 5e^{2x} \end{gather*}
match coefficients:
\(A = 5 \)
particular solution:
\(\ds y_p = 5 x e^{2x} \)
general solution:
\(\ds y = c_1 e^x + c_2 e^{2x} + 5 x e^{2x} \)

🌌 Example 176. Trigonometric Forcing Function.

Find the general solution of
\begin{equation*} y'' + y = \cos(2x). \end{equation*}
Solution.
characteristic equation:
\(\ds r^2 + 1 = 0 \Rightarrow r = \pm i \)
homogeneous solution:
\(\ds y_h = c_1 \cos x + c_2 \sin x \)
initial \(y_p\text{:}\)
\(\ds A \cos 2x + B \sin 2x \)
\(\{\cos 2x, \sin 2x\}\) and \(\{\cos x, \sin x\}\) are not like terms ➜ No modification needed.
compute \(y_p'\) and \(y_p''\text{:}\)
\begin{gather*} y_p' = -2A \sin 2x + 2B \cos 2x \\ y_p'' = -4A \cos 2x - 4B \sin 2x \end{gather*}
substitute \(y_p\text{,}\) \(y_p'\text{:}\)
\begin{equation*} (-4A \cos 2x - 4B \sin 2x) + (-2A \sin 2x + 2B \cos 2x) = \cos 2x \end{equation*}
group like-terms:
\(\ds (-4A + 2B) \cos 2x + (-2A - 4B) \sin 2x = \cos 2x \)
Match coefficients:
\begin{align*} -4A + 2B \amp = 1 \\ -2A - 4B \amp = 0 \end{align*}
\begin{gather*} \Rightarrow \end{gather*}
\begin{align*} -4A + 2B \amp = 1 \\ 4A + 8B \amp = 0 \end{align*}
\begin{gather*} \Rightarrow \end{gather*}
\begin{align*} A \amp = \sfrac{2}{10} \\ B \amp = \sfrac{1}{10} \end{align*}
particular solution:
\(\ds y_p = \frac{2}{10} \sin 2x + \frac{1}{10} \cos 2x \)
\begin{equation*} y = c_1 \cos x + c_2 \sin x + \frac{2}{10} \sin 2x + \frac{1}{10} \cos 2x \end{equation*}

🌌 Example 177. Second-Order LNCC with \(y_p\) Modification.

Find the general solution of
\begin{equation*} y'' + 3y' - 28y = 14t - 1 + e^{4t} \end{equation*}
Solution.
characteristic equation:
\begin{align*} r^2 + 3r - 28 = 0 \amp\quad\Rightarrow\quad (r - 4)(r + 7) = 0 \\ \amp\quad\Rightarrow\quad r = 4, -7 \end{align*}
homogeneous solution:
\(\ds y_h = c_1 e^{4t} + c_2 e^{-7t} \)
initial \(y_p\text{:}\)
\(\ds y_p = At + B + Ce^{4t} \)
Since \(y_p\) and \(y_h\) share an \(e^{4t}\) term, we modify this term in \(y_p\text{:}\)
modified \(y_p\text{:}\)
\(\ds y_p = At + B + Ct\,e^{4t} \)
compute \(y_p'\text{,}\) \(y_p''\text{:}\)
\begin{align*} y_p' \amp = A + C e^{4t} + 4Ct\, e^{4t}\\ y_p'' \amp = 8C e^{4t} + 16Ct\, e^{4t} \end{align*}
substitute \(y_p\text{,}\) \(y_p'\text{,}\) \(y_p''\text{:}\)
\begin{align*} 8C\ e^{4t} + 16Ct\, e^{4t} + 3(A + C e^{4t} + 4Ct\, e^{4t}) - 28(At \amp + B + Ct\, e^{4t})\\ \amp = 14t - 1 + e^{4t} \end{align*}
The \(te^{4t}\) terms cancel, but you can group the \(e^{4t}\text{,}\) \(t\text{,}\) and free terms:
\begin{align*} \us{\ds\text{1️⃣}}{\ul{11C}} e^{4t} - \us{\ds\text{2️⃣}}{\ul{28A}} t \amp + \us{\ds\text{3️⃣}}{\ul{3A - 28B}} = \us{\ds\text{2️⃣}}{\ul{14}} t + \us{\ds\text{3️⃣}}{\ul{-1}} + \us{\ds\text{1️⃣}}{\ul{1}} e^{4t} \end{align*}
match coefficients:
\begin{align*} \amp\ \text{1️⃣} \\ \amp\ \text{2️⃣} \\ \amp\ \text{3️⃣} \end{align*}
\begin{align*} 11C \amp = 1 \\ -28A \amp = 14 \\ 3A - 28B \amp = -1 \end{align*}
\begin{gather*} \rightarrow \\ \rightarrow \\ \rightarrow \end{gather*}
\begin{align*} \amp\ C = 1/11 \\ \amp\ A = -1/2 \\ \amp\ B = -1/56 \end{align*}
particular solution:
\(\ds y_p = -\frac{1}{2} t - \frac{1}{56} + \frac{1}{11} t e^{4t} \)
general solution:
\(\ds y = c_1 e^{4t} + c_2 e^{-7t} - \frac{1}{2} t - \frac{1}{56} + \frac{1}{11} t e^{4t} \)

🌌 Example 178. Forcing Function as a Product.

Find the general solution of
\begin{equation*} y'' - 10y' = x \sin x \end{equation*}
Solution.
characteristic equation:
\(\ds r^2 - 10r = 0, \ r(r - 10) = 0, \ r = 0, 10 \)
homogeneous solution:
\(\ds y_h = c_1 + c_2 e^{10x} \)
initial \(y_p\text{:}\)
\(\ds y_p = (A x + B) \cos x + (C x + D) \sin x \)
Note: This part can be a bit intense. The product rule is used multiple times and after each step, we regroup the \(\cos x\text{,}\) \(\sin x\text{,}\) \(x\cos x\text{,}\) and \(x\sin x\) terms.
compute \(y_p'\) and \(y_p''\text{:}\)
\begin{align*} y_p' \amp = A \cos x - (Ax + B) \sin x + C \sin x + (Cx + D) \cos x \\ \amp = (A + D)\cos x + (-B + C)\sin x + Cx\cos x - Ax\sin x \\ y_p'' \amp = -(A + D)\sin x + (-B + C)\cos x \\ \amp \hspace{4cm} + C\cos x - Cx\sin x - A\sin x - Ax\cos x \\ \amp = (-B + 2C)\cos x + (-2A + D)\sin x - Ax\cos x - Cx\sin x \end{align*}
substitute \(y_p''\text{,}\) \(y_p'\text{:}\)
\begin{align*} ((-B \amp + 2C)\cos x + (-2A + D)\sin x - Ax\cos x - Cx\sin x) \\ \amp - 10((A + D)\cos x + (-B + C)\sin x + Cx\cos x - Ax\sin x) = x \sin x \end{align*}
group like-terms:
\begin{align*} \amp (-B + 2C - 10A - 10D)\cos x \\ \amp +\ (-2A + D + 10B - 10C)\sin x \\ \amp +\ (-A + C)\ x\cos x + {\DLO (-C - A)}\ x\sin x = {\DLO 1} x \sin x \end{align*}
Match coefficients:
\begin{align*} -B + 2C - 10A - 10D \amp = 0 \\ -2A + D + 10B - 10C \amp = 0 \end{align*}
\begin{align*} -A + C \amp = 0 \\ {\DLO -C - A} \amp = {\DLO 1} \end{align*}
\begin{gather*} \Rightarrow \end{gather*}
\begin{align*} A \amp = \sfrac12 \\ C \amp = \sfrac12 \end{align*}
Substituting \(A = \sfrac12\) and \(C = \sfrac12\) into the first two equations gives:
\begin{align*} -B - 10D \amp = 4 \\ 10B + D \amp = 6 \end{align*}
\begin{gather*} \Rightarrow \end{gather*}
\begin{align*} -10B - 100D \amp = 40 \\ 10B + D \amp = 6 \end{align*}
\begin{gather*} \Rightarrow \end{gather*}
\begin{align*} B \amp = \sfrac{64}{99} \\ D \amp = \sfrac{46}{99} \end{align*}
particular solution:
\begin{equation*} y_p = \left(\frac{1}{2} + \frac{64}{99}x\right) \cos x + \left(\frac{1}{2} + \frac{46}{99}x\right) \sin x \end{equation*}
General solution:
\begin{equation*} y = c_1 \cos x + c_2 \sin x + \left(\frac{1}{2} + \frac{64}{99}x\right) \cos x + \left(\frac{1}{2} + \frac{46}{99}x\right) \sin x \end{equation*}
These examples illustrate the systematic nature of this method. No matter how complex the forcing function, the steps remain consistent: identify the homogeneous solution, propose a form for the particular solution, modify it if necessary, compute derivatives, substitute into the differential equation, and match coefficients to solve for unknowns.

Subsection πŸ“€ Wrap-Up

πŸ—οΈ \(\textbf{Key Takeaways...}\)
  • The general solution to a nonhomogeneous differential equation is \(y = y_h + y_p\text{,}\) where \(y_h\) solves the homogeneous equation and \(y_p\) accounts for the forcing function.
  • The Method of Undetermined Coefficients provides a systematic way to find \(y_p\) when \(f(x)\) consists of polynomials, exponentials, sines, cosines, or their combinations.
  • Choose \(y_p\) by matching the form of \(f(x)\) and modify it by multiplying by \(x\) when necessary to avoid overlap with \(y_h\text{.}\)
  • Substitute \(y_p\) and its derivatives into the differential equation, simplify, and match like terms to solve for unknown coefficients.

Check Your Understanding.

Checkpoint 179. πŸ€”πŸ’­ Separation of Variables Reading Questions.
(a) πŸ€”πŸ’­ SOV and Nonlinear Equations.
    The separation of variables method cannot be applied to non-linear differential equations.
  • True.

  • Being able to solve non-linear differential equations is one of the strengths of the separation of variables method.
  • False.

  • Being able to solve non-linear differential equations is one of the strengths of the separation of variables method.
(b) πŸ€”πŸ’­ Sort the Steps in Order.
(c) πŸ€”πŸ’­ Combining Constants.
Which of the following are valid ways to combine constants when finalizing your solution? Select ALL that apply.
  • \(\quad \left\{ \begin{align} |y| \amp = e^{2x + c_1}\\ y \amp = c_2 e^{2x} \end{align} \right.\qquad\) where \(c_2=\pm e^{c_1}\text{.}\)
  • Correct, since
    \begin{align*} |y| \amp =, e^{2x + c_1} \\ y \amp =, \pm e^{2x + c_1} \\ y \amp =, \pm e^{2x} \cdot e^{c_1} \\ y \amp =, c_2 e^{2x} \quad \text{where } c_2 = \pm e^{c_1} \end{align*}
  • \(\quad \left\{ \begin{align} \frac{y^2}{2} \amp = \sin(x) + c_1\\ y^2 \amp = 2\sin(x) + c_2 \end{align} \right.\qquad\) where \(c_2 = 2c_1\text{.}\)
  • Correct, since
    \begin{align*} \frac{y^2}{2} \amp =, \sin(x) + c_1 \\ y^2 \amp =, \sin(x) + 2c_1 \\ y^2 \amp =, 2\sin(x) + c_2 \quad \text{where } c_2 = 2c_1 \end{align*}
  • \(\quad \left\{ \begin{align} y^2 \amp = 2\sin(x) + c_2\\ y \amp = \pm\sqrt{2\sin(x)} + c_3 \end{align} \right.\qquad\) where \(c_3=\pm \sqrt{c_2}\text{.}\)
  • Incorrect, you should not combine constants here since \(\quad\sqrt{A + B} \neq \sqrt{A} + \sqrt{B}\text{.}\)
    Your solution should be written as
    \begin{align*} y^2 \amp =, 2\sin(x) + c_2 \\ y \amp =, \pm\sqrt{2\sin(x) + c_2}\quad \leftarrow\text{ done} \end{align*}
  • \(\quad \left\{ \begin{align} e^y \amp = 3y + c_1\\ y \amp = \ln(3y) + c_2 \end{align} \right.\qquad\) where \(c_2= \ln(c_1)\text{.}\)
  • Incorrect, you should not combine constants here since \(\ln(A + B) \neq \ln(A) + \ln(B)\text{.}\)
    Your solution should be
    \begin{align*} e^y \amp =, 3y + c_1 \\ y \amp =, \ln(3y + c_1)\quad \leftarrow\text{ done} \end{align*}
  • \(\quad \left\{ \begin{align} xy \amp = e^x + c_1\\ y \amp = \frac{e^x}{x} + c_2 \end{align} \right.\qquad\) where \(\ds c_2=\frac{c_1}{x}\text{.}\)
  • Incorrect, you should not combine constants here since \(\frac{c_1}{x}\) is not constant. Instead your solution should be left as
    \begin{align*} xy \amp =, e^x + c_1 \\ y \amp =, \frac{e^x + c_1}{x} \\ y \amp =, \frac{e^x}{x} + \frac{c_1}{x}\quad \leftarrow\text{ done} \end{align*}
  • \(\quad \left\{ \begin{align} \sqrt{y} \amp = c_1e^{3x}\\ y \amp = c_2\, e^{6x} \end{align} \right.\qquad\) where \(c_2= c_1^2\text{.}\)
  • Correct, since
    \begin{align*} \sqrt{y} \amp =, c_1e^{3x} \\ y \amp =, (c_1e^{3x})^2 \\ y \amp =, c_1^2(e^{3x})^2 \\ y \amp =, c_2\, e^{6x}\quad \text{where } c_2 = c_1^2 \end{align*}
You have attempted of activities on this page.