The method of undetermined coefficients involves making educated guesses about the form of the particular solution based on the form of [latex]r(x)[/latex]. When we take derivatives of polynomials, exponential functions, sines, and cosines, we get polynomials, exponential functions, sines, and cosines. So when [latex]r(x)[/latex] has one of these forms, it is possible that the solution to the nonhomogeneous differential equation might take that same form.
Find the general solution to [latex]y^{\prime\prime}+4y^\prime+3y=3x[/latex].
The complementary equation is [latex]y^{\prime\prime}+4y^\prime+3y=0[/latex], with general solution [latex]c_1e^{-x}+c_2e^{-3x}[/latex]. Since [latex]r(x)=3x[/latex], the particular solution might have the form [latex]y_p(x)=Ax+B[/latex]. If this is the case, then we have [latex]y_p^\prime(x)=A[/latex] and [latex]y_py^{\prime\prime}(x)=0[/latex]. For [latex]y_p[/latex] to be a solution to the differential equation, we must find values for [latex]A[/latex] and [latex]B[/latex] such that
In the example above, notice that even though [latex]r(x)[/latex] did not include a constant term, it was necessary to include the constant term in our guess. If we had assumed a solution of the form [latex]y_p=Ax[/latex] (with no constant term), we would not have been able to find a solution.
If the function [latex]r(x)[/latex] is a polynomial, our guess for the particular solution should be a polynomial of the same degree, and it must include all lower-order terms, regardless of whether they are present in [latex]r(x)[/latex].
Find the general solution to [latex]y^{\prime\prime}-y^\prime-2y=2e^{3x}[/latex].
The complementary equation is [latex]y^{\prime\prime}-y^\prime-2y=0[/latex], with the general solution [latex]c_1e^{-x}+c_2e^{2x}[/latex]. Since [latex]r(x)=2e^{3x}[/latex], the particular solution might have the form [latex]y_p=Ae^{3x}[/latex]. Then, we have [latex]y_p^\prime(x)=3Ae^{3x}[/latex] and [latex]y^{\prime\prime}=9Ae^{3x}[/latex]. For [latex]y_p[/latex] to be a solution to the differential equation, we must find a value for [latex]A[/latex] such that
When [latex]r(x)[/latex] includes both sine and cosine terms, both terms must be present in the guess—even if [latex]r(x)[/latex] included only a sine term or only a cosine term.
The method of undetermined coefficients also works with products of polynomials, exponentials, sines, and cosines. Some of the key forms of [latex]r(x)[/latex] and the associated guesses for [latex]y_p(x)[/latex] are summarized below.
key forms for the method of undetermined coefficients
[latex]r(x)[/latex]
Initial guess for [latex]y_p(x)[/latex]
[latex]k[/latex] (a constant)
[latex]A[/latex] (a constant)
[latex]ax+b[/latex]
[latex]Ax+B[/latex]
[latex]ax^{2}+bx+c[/latex]
[latex]Ax^{2}+Bx+C[/latex]
Higher-order polynomials
Polynomial of the same order as [latex]r(x)[/latex]
Table 7.2 Key Forms for the Method of Undetermined Coefficients
Note: For polynomial guesses, the guess must include all lower-order terms, even if they have zero coefficients in [latex]r(x)[/latex]. For trigonometric guesses, both sine and cosine terms must be included, even if only one appears in [latex]r(x)[/latex].
A Key Pitfall
There is an important issue to watch for with this method. Consider the differential equation [latex]y^{\prime\prime}+5y^\prime+6y=3e^{-2x}[/latex]. Based on the form of [latex]r(x)[/latex], we guess a particular solution of the form [latex]y_p(x)=Ae^{-2x}[/latex]. But when we substitute this expression into the differential equation to find a value for [latex]A[/latex], we run into a problem.
We have [latex]y_p^\prime(x)=-2Ae^{-2x}[/latex] and [latex]y_p^{\prime\prime}(x)=4Ae^{-2x}[/latex], so we want:
Looking closely, we see that the general solution to the complementary equation is [latex]c_1e^{-2x}+c_2e^{-3x}[/latex]. The exponential function in [latex]r(x)[/latex] is actually a solution to the complementary equation, so all the terms on the left side of the equation cancel out.
We can still use the method of undetermined coefficients in this case, but we have to alter our guess by multiplying it by [latex]x[/latex]. Using the new guess, [latex]y_p(x)=Axe^{-2x}[/latex], we have:
If [latex]xe^{-2x}[/latex] were also a solution to the complementary equation, we would have to multiply by [latex]x[/latex] again, and we would try [latex]y_p(x)=Ax^2e^{-2x}[/latex].How to: Use the Method of Undetermined Coefficients
Solve the complementary equation: Write down the general solution.
Make an initial guess for [latex]y_p(x)[/latex]: Base your guess on the form of [latex]r(x)[/latex].
Check for conflicts with the complementary solution: If any term in the guess for [latex]y_p(x)[/latex] is a solution to the complementary equation, multiply the guess by [latex]x[/latex]. Repeat this step until there are no terms in [latex]y_p(x)[/latex] that solve the complementary equation.
Substitute and solve for coefficients: Substitute [latex]y_p(x)[/latex] into the differential equation and equate like terms to find values for the unknown coefficients in [latex]y_p(x)[/latex].
Write the general solution: Add the general solution to the complementary equation and the particular solution you just found.
Find the general solutions to the following differential equations.
The complementary equation is [latex]y^{\prime\prime}-9y=0[/latex], which has the general solution [latex]c_1e^{3x}+c_2e^{-3x}[/latex] (step 1). Based on the form of [latex]r(x)=-6\cos3x[/latex], our initial guess for the particular solution is [latex]y_p(x)=A\cos3x+B\sin3x[/latex] (step 2). None of the terms in [latex]y_p(x)[/latex] solve the complementary equation, so this is a valid guess (step 3). Now we want to find values for [latex]A[/latex] and [latex]B[/latex], so substitute [latex]y_p[/latex] into the differential equation. We have
[latex]\large{y_p^\prime(x)=-3A\sin3x+3B\cos3x\text{ and }y_p^{\prime\prime}(x)=-9A\cos3x-9B\sin3x}[/latex],
so we want to find values of [latex]A[/latex] and [latex]B[/latex] such that
This gives [latex]A=\frac{1}{3}[/latex] and [latex]B=0[/latex], so [latex]y_p(x)=\left(\frac13\right)\cos3x[/latex] (step 4). Putting everything together, we have the general solution
The complementary equation is [latex]x^{\prime\prime}+2x^\prime+x=0[/latex], which has the general solution [latex]c_1e^{-t}+c_2te^{-t}[/latex] (step 1). Based on the form [latex]r(t)=4e^{-t}[/latex], our initial guess for the particular solution is [latex]x_p(t)=Ae^{-t}[/latex] (step 2). However, we see that this guess solves the complementary equation, so we must multiply by [latex]t[/latex], which gives a new guess: [latex]x_p(t)=Ate^{-t}[/latex] (step 3). Checking this new guess, we see that it, too, solves the complementary equation, so we must multiply by [latex]t[/latex] again, which gives [latex]x_p(t)=At^2e^{-t}[/latex] (step 3 again). Now, checking this guess, we see that [latex]x_p(t)[/latex] does not solve the complementary equation, so this is a valid guess (step 3 yet again). We now want to find a value for [latex]A[/latex], so we substitute [latex]x_p[/latex] into the differential equation. We have
and [latex]x_p^{\prime\prime}=2Ae^{-t}-2Ate^{-t}-\left(2Ate^{-t}-At^2e^{-t}\right)=2Ae^{-t}-4Ate^{-t}+At^2e^{-t}[/latex].
Substituting into the differential equation, we want to find a value of [latex]A[/latex] so that
The complementary equation is [latex]y^{\prime\prime}-2y^\prime+5y=0[/latex], which has the general solution [latex]c_1e^x\cos2x+c_2e^x\sin2x[/latex] (step 1). Based on the form [latex]r(x)=10x^2-3x-3[/latex], our initial guess for the particular solution is [latex]y_p(x)=Ax^2+Bx+C[/latex] (step 2). None of the terms in [latex]y_p(x)[/latex] solve the complementary equation, so this is a valid guess (step 3). We now want to find values for [latex]A[/latex], [latex]B[/latex], and [latex]C[/latex], so we substitute [latex]y_p[/latex] into the differential equation. We have [latex]y_p^\prime(x)=2Ax+B[/latex] and [latex]y_p^{\prime\prime}(x)=2A[/latex], so we want to find values of [latex]A[/latex], [latex]B[/latex], and [latex]C[/latex] such that
This gives [latex]A=2[/latex], [latex]B=1[/latex], and [latex]C=-1[/latex], so [latex]y_p(x)=2x^2+x-1[/latex] (step 4). Putting everything together, we have the general solution
The complementary equation is [latex]y^{\prime\prime}-3y^\prime=0[/latex], which has the general solution [latex]c_1e^{3t}+c_2[/latex] (step 1). Based on the form [latex]r(t)=-12t[/latex], our initial guess for the particular solution is [latex]y_p(t)=At+B[/latex] (step 2). However, we see that the constant term in this guess solves the complementary equation, so we must multiply by [latex]t[/latex], which gives a new guess: [latex]y_P(t)=At^2+Bt[/latex] (step 3). Checking this new guess, we see that none of the terms in [latex]y_p(t)[/latex] solve the complementary equation, so this is a valid guess (step 3 again). We now want to find values for [latex]A[/latex] and [latex]B[/latex], so we substitute [latex]y_p[/latex] into the differential equation. We have [latex]y_p^\prime(t)=2At+B[/latex] and [latex]y_p^{\prime\prime}(t)=2A[/latex], so we want to find values of [latex]A[/latex] and [latex]B[/latex] such that
This gives [latex]A=2[/latex] and [latex]b=4/3[/latex], so [latex]y_p(t)=2t^2+(4/3)t[/latex] (step 4). Putting everything together, we have the general solution