Method of Undetermined Coefficients (2025)

This page is about second order differential equations of this type:

d2ydx2 + P(x)dydx + Q(x)y = f(x)

where P(x), Q(x) and f(x) are functions of x.

Please read Introduction to Second Order Differential Equations first, it shows how to solve the simpler "homogeneous" case where f(x)=0

Two Methods

There are two main methods to solve these equations:

Undetermined Coefficients (that we learn here) which only works when f(x) is a polynomial, exponential, sine, cosine or a linear combination of those.

Variation of Parameters which is a little messier but works on a wider range of functions.

Undetermined Coefficients

To keep things simple, we only look at the case:

d2ydx2 + pdydx + qy = f(x)

where p and q are constants.

The complete solution to such an equation can be found by combining two types of solution:

  1. The general solution of the homogeneous equation

    d2ydx2 + pdydx + qy = 0

  2. Particular solutions of the non-homogeneous equation

    d2ydx2 + pdydx + qy = f(x)

Note that f(x) could be a single function or a sum of two or more functions.

Once we have found the general solution and all the particular solutions, then the final complete solution is found by adding all the solutions together.

Example 1: d2ydx2 − y = 2x2 − x − 3

(For the moment trust me regarding these solutions)

The homogeneous equation d2ydx2 − y = 0 has a general solution

y = Aex + Be-x

The non-homogeneous equation d2ydx2 − y = 2x2 − x − 3 has a particular solution

y = −2x2 + x − 1

So the complete solution of the differential equation is

y = Aex + Be-x − 2x2 + x − 1

Let’s check if the answer is correct:

y = Aex + Be-x − 2x2 + x − 1

dydx = Aex − Be-x − 4x + 1

d2ydx2 = Aex + Be-x − 4

Putting it together:

d2ydx2 − y = Aex + Be-x − 4 − (Aex + Be-x − 2x2 + x − 1)

= Aex + Be-x − 4 − Aex − Be-x + 2x2 − x + 1

= 2x2 − x − 3

So in this case we have shown that the answer is correct, but how do we find the particular solutions?

We can try guessing ... !

This method is only easy to apply if f(x) is one of the following:

Either:f(x) is a polynomial function.

Or:f(x) is a linear combination of sine and cosine functions.

Or:f(x) is an exponential function.

And here is a guide to help us with a guess:

f(x)y(x) guess
aebxAebx
a cos(cx) + b sin(cx)A cos(cx) + B sin(cx)
kxn (n=0, 1, 2,...)Anxn + An−1xn−1 + … + A0

But there is one important rule that must be applied:

You must first find the general solution to the homogeneous equation.

You will see why as we continue on.

Example 1 (again): Solve d2ydx2 − y = 2x2 − x − 3

1. Find the general solution of

d2ydx2 − y = 0

The characteristic equation is: r2 − 1 = 0

Factor: (r − 1)(r + 1) = 0

r = 1 or −1

So the general solution of the differential equation is

y = Aex + Be-x

2. Find the particular solution of

d2ydx2 − y = 2x2 − x − 3

We make a guess:

Let y = ax2 + bx + c

dydx = 2ax + b

d2ydx2 = 2a

Substitute these values into d2ydx2 − y = 2x2 − x − 3

2a − (ax2 + bx + c) = 2x2 − x − 3

2a − ax2 − bx − c = 2x2 − x − 3

− ax2 − bx + (2a − c) = 2x2 − x − 3

Equate coefficients:

x2 coefficients:−a = 2 a = −2 ... (1)
x coefficients:−b = −1 b = 1 ... (2)
Constant coefficients:2a − c = −3 ... (3)

Substitute a = −2 from (1) into (3)

−4 − c = −3

c = −1

a = −2, b = 1 and c = −1, so the particular solution of the differential equation is

y = − 2x2 + x − 1

Finally, we combine our two answers to get the complete solution:

y = Aex + Be-x − 2x2 + x − 1

Why did we guess y = ax2 + bx + c (a quadratic function) and not include a cubic term (or higher)?

The answer is simple. The function f(x) on the right side of the differential equation has no cubic term (or higher); so, if y did have a cubic term, its coefficient would have to be zero.

Hence, for a differential equation of the type d2ydx2 + pdydx + qy = f(x) where f(x) is a polynomial of degree n, our guess for y will also be a polynomial of degree n.


Example 2: Solve

6d2ydx2 − 13dydx − 5y = 5x3 + 39x2 − 36x − 10

1. Find the general solution of 6d2ydx2 − 13dydx − 5y = 0

The characteristic equation is: 6r2 − 13r − 5 = 0

Factor: (2r − 5)(3r + 1) = 0

r = 52 or −13

So the general solution of the differential equation is

y = Ae(5/2)x + Be(−1/3)x

2. Find the particular solution of 6d2ydx2 − 13dydx − 5y = 5x3 + 39x2 − 36x − 10

Guess a cubic polynomial because 5x3 + 39x2 − 36x − 10 is cubic.

Let y = ax3 + bx2 + cx + d

dydx = 3ax2 + 2bx + c

d2ydx2 = 6ax + 2b

Substitute these values into 6d2ydx2 − 13dydx −5y = 5x3 + 39x2 −36x −10

6(6ax + 2b) − 13(3ax2 + 2bx + c) − 5(ax3 + bx2 + cx + d) = 5x3 + 39x2 − 36x − 10

36ax + 12b − 39ax2 − 26bx − 13c − 5ax3 − 5bx2 − 5cx − 5d = 5x3 + 39x2 − 36x − 10

−5ax3 + (−39a − 5b)x2 + (36a − 26b − 5c)x + (12b − 13c − 5d) = 5x3 + 39x2 − 36x − 10

Equate coefficients:

x3 coefficients:−5a = 5 a = −1
x2 coefficients:−39a −5b = 39 b = 0
x coefficients:36a −26b −5c = −36 c = 0
Constant coefficients:12b − 13c −5d = −10 d = 2

So the particular solution is:

y = −x3 + 2

Finally, we combine our two answers to get the complete solution:

y = Ae(5/2)x + Be(−1/3)x − x3 + 2

And here are some sample curves:

Method of Undetermined Coefficients (1)


Example 3: Solve d2ydx2 + 3dydx − 10y = −130cos(x) + 16e3x

In this case we need to solve three differential equations:

1. Find the general solution to d2ydx2 + 3dydx − 10y = 0

2. Find the particular solution to d2ydx2 + 3dydx − 10y = −130cos(x)

3. Find the particular solution to d2ydx2 + 3dydx − 10y = 16e3x

So, here’s how we do it:

1. Find the general solution to d2ydx2 + 3dydx − 10y = 0

The characteristic equation is: r2 + 3r − 10 = 0

Factor: (r − 2)(r + 5) = 0

r = 2 or −5

So the general solution of the differential equation is:

y = Ae2x+Be-5x

2. Find the particular solution to d2ydx2 + 3dydx − 10y = −130cos(x)

Guess. Since f(x) is a cosine function, we guess that y is a linear combination of sine and cosine functions:

Try y = acos⁡(x) + bsin(x)

dydx = − asin(x) + bcos(x)

d2ydx2 = − acos(x) − bsin(x)

Substitute these values into d2ydx2 + 3dydx − 10y = −130cos(x)

−acos⁡(x) − bsin(x) + 3[−asin⁡(x) + bcos(x)] − 10[acos⁡(x)+bsin(x)] = −130cos(x)

cos(x)[−a + 3b − 10a] + sin(x)[−b − 3a − 10b] = −130cos(x)

cos(x)[−11a + 3b] + sin(x)[−11b − 3a] = −130cos(x)

Equate coefficients:

Coefficients of cos(x):−11a + 3b = −130 ... (1)
Coefficients of sin(x):−11b − 3a = 0 ... (2)

From equation (2), a = −11b3

Substitute into equation (1)

121b3 + 3b = −130

130b3 = −130

b = −3

a = −11(−3)3 = 11

So the particular solution is:

y = 11cos⁡(x) − 3sin(x)

3. Find the particular solution to d2ydx2 + 3dydx − 10y = 16e3x

Guess.

Try y = ce3x

dydx = 3ce3x

d2ydx2 = 9ce3x

Substitute these values into d2ydx2 + 3dydx − 10y = 16e3x

9ce3x + 9ce3x − 10ce3x = 16e3x

8ce3x = 16e3x

c = 2

So the particular solution is:

y = 2e3x

Finally, we combine our three answers to get the complete solution:

y = Ae2x + Be-5x + 11cos⁡(x) − 3sin(x) + 2e3x


Example 4: Solve d2ydx2 + 3dydx − 10y = −130cos(x) + 16e2x

This is exactly the same as Example 3 except for the final term, which has been replaced by 16e2x.

So Steps 1 and 2 are exactly the same. On to step 3:

3. Find the particular solution to d2ydx2 + 3dydx − 10y = 16e2x

Guess.

Try y = ce2x

dydx = 2ce2x

d2ydx2 = 4ce2x

Substitute these values into d2ydx2 + 3dydx − 10y = 16e2x

4ce2x + 6ce2x − 10ce2x = 16e2x

0 = 16e2x

Oh dear! Something seems to have gone wrong. How can 16e2x = 0?

Well, it can’t, and there is nothing wrong here except that there is no particular solution to the differential equation d2ydx2 + 3dydx − 10y = 16e2x

...Wait a minute!
The general solution to the homogeneous equation d2ydx2 + 3dydx − 10y = 0, which is y = Ae2x + Be-5x, already has a term Ae2x, so our guess y = ce2x already satisfies the differential equation d2ydx2 + 3dydx − 10y = 0 (it was just a different constant.)

So we must guess y = cxe2x

Let's see what happens:

dydx = ce2x + 2cxe2x

d2ydx2 = 2ce2x + 4cxe2x + 2ce2x = 4ce2x + 4cxe2x

Substitute these values into d2ydx2 + 3dydx − 10y = 16e2x

4ce2x + 4cxe2x + 3ce2x + 6cxe2x − 10cxe2x = 16e2x

7ce2x = 16e2x

c = 167

So in the present case our particular solution is

y = 167xe2x

Thus, our final complete solution in this case is:

y = Ae2x + Be-5x + 11cos⁡(x) − 3sin(x) + 167xe2x


Example 5: Solve d2ydx2 − 6dydx + 9y = 5e-2x

1. Find the general solution to d2ydx2 − 6dydx + 9y = 0

The characteristic equation is: r2 − 6r + 9 = 0

(r − 3)2 = 0

r = 3, which is a repeated root.

Then the general solution of the differential equation is y = Ae3x + Bxe3x

2. Find the particular solution to d2ydx2 − 6dydx + 9y = 5e-2x

Guess.

Try y = ce-2x

dydx = −2ce-2x

d2ydx2 = 4ce-2x

Substitute these values into d2ydx2 − 6dydx + 9y = 5e-2x

4ce-2x + 12ce-2x + 9ce-2x = 5e-2x

25e-2x = 5e-2x

c = 15

So the particular solution is:

y= 15e-2x

Finally, we combine our two answers to get the complete solution:

y= Ae3x + Bxe3x + 15e-2x


Example 6: Solve d2ydx2 + 6dydx + 34y = 109cos(5x)

1. Find the general solution to d2ydx2 + 6dydx + 34y = 0

The characteristic equation is: r2 + 6r + 34 = 0

Use the quadratic equation formula

r = −b ± √(b2 − 4ac)2a

with a = 1, b = 6 and c = 34

So

r = −6 ± √[62 − 4(1)(34)]2(1)

r = −6 ± √(36−136)2

r = −6 ± √(−100)2

r = −3 ± 5i

And we get:

y =e-3x(Acos⁡(5x) + iBsin(5x))

2. Find the particular solution to d2ydx2 + 6dydx + 34y = 109sin(5x)

Since f(x) is a sine function, we assume that y is a linear combination of sine and cosine functions:

Guess.

Try y = acos⁡(5x) + bsin(5x)

Note: since we do not have sin(5x) or cos(5x) in the solution to the homogeneous equation (we have e-3xcos(5x) and e-3xsin(5x), which are different functions), our guess should work.

Let’s continue and see what happens:

dydx = −5asin⁡(5x) + 5bcos(5x)

d2ydx2 = −25acos⁡(5x) − 25bsin(5x)

Substitute these values into d2ydx2 + 6dydx + 34y = 109sin(5x)

−25acos⁡(5x) − 25bsin(5x) + 6[−5asin⁡(5x) + 5bcos(5x)] + 34[acos⁡(5x) + bsin(5x)] = 109sin(5x)

cos(5x)[−25a + 30b + 34a] + sin(5x)[−25b − 30a + 34b] = 109sin(5x)

cos(5x)[9a + 30b] + sin(5x)[9b − 30a] = 109sin(5x)

Equate coefficients of cos(5x) and sin(5x):

Coefficients of cos(5x):9a + 30b = 0 ... (1)
Coefficients of sin(5x):9b − 30a = 109 ... (2)

From equation (1), b = −3a10

Substitute into equation (2)

9(−3a10) − 30a = 109

−27a − 300a = 1090

−327a = 1090

a = −103

b = 1

So the particular solution is:

y = −103cos⁡(5x) + sin(5x)

Finally, we combine our answers to get the complete solution:

y = e-3x(Acos⁡(5x) + iBsin(5x)) − 103cos⁡(5x) + sin(5x)

9509, 9510, 9511, 9512, 9513, 9514, 9515, 9516, 9517, 9518

Homogeneous Functions Differential Equation Differential Equations Solution Guide Calculus Index

Method of Undetermined Coefficients (2025)

FAQs

What is the method of the undetermined coefficients? ›

Solutions by the method of Undetermined Coefficients sometimes called the Superposition Approach, is where we make a “guess” as to the appropriate form for our solution set, which is then tested by differentiating the resulting equation.

How to find yp in method of undetermined coefficients? ›

yp(x) = “second guess” = x × “the first guess” . yp(x) = “the third guess” where “third guess” = x × “the second guess” = x2 × “the first guess” . I should emphasize that the second guess is used only if the first fails (i.e., has a term that satisfies the homogeneous equation).

When can you not use undetermined coefficients? ›

Here we have a situation where the method of undetermined coefficients typically fails, when the forcing function (right hand side) is linearly dependent on the fundamental set of solutions to the homogeneous equation.

When to use method of undetermined coefficients vs. variation of parameters? ›

There are two methods for finding a particular solution: The method of undetermined coefficients is straightforward but works only for a restricted class of func- tions . The method of variation of parameters works for every function but is usually more difficult to apply in practice.

What is mathematical model using undetermined coefficients? ›

The method of undetermined coefficients is a technique used to solve non-homogeneous constant coefficient second-order linear differential equations. This method involves assuming a particular form for the solution and then determining the coefficients that make the assumed solution satisfy the differential equation.

How do you find the unknown coefficient? ›

Determine the unknown coefficients in y p ( t ) by substituting y p ( t ) into the nonhomogeneous equation, y ′ + k y = q ( t ) , and equating the coefficients of like terms.

What is the modification rule in method of undetermined coefficients? ›

(b) Modification Rule.

If a term in your choice for happens to be a solution of the homogeneous ODE corresponding to (4), multiply this term by x (or by if this solution corresponds to a double root of the characteristic equation of the homogeneous ODE).

What are the limitations of undetermined coefficients? ›

Pros and Cons of the Method of Undetermined Coefficients:The method is very easy to perform. However, the limitation of the method of undetermined coefficients is that the non-homogeneous term can only contain simple functions such as , , , and so the trial function can be effectively guessed.

Can you still use the elimination method if you do not have equal coefficients for both variables? ›

Yes you can still solve a system of equations by elimination even if the coefficients of the variables are not equal. One must remember that if one has an equation such as a = b then you can multiply the entire equation through by a constant and still have a true equation.... If a = b then 2a = 2b.

What are the advantages of the method of undetermined coefficients? ›

Section 3.9 : Undetermined Coefficients. In this section we will take a look at the first method that can be used to find a particular solution to a nonhomogeneous differential equation. One of the main advantages of this method is that it reduces the problem down to an algebra problem.

Can you use the method of undetermined coefficients with tan? ›

The method of undetermined coefficients could not be applied if the nonhomogeneous term in (*) were d = tan x.

When to use method of variation of parameters? ›

In theory, the method of variation of parameters will work whenever g and the coefficients are reasonably continuous functions.

What is the method of determination of coefficient? ›

The coefficient of determination or R squared method is the proportion of the variance in the dependent variable that is predicted from the independent variable. It indicates the level of variation in the given data set. The coefficient of determination is the square of the correlation(r), thus it ranges from 0 to 1.

What is the method of equating coefficients? ›

In mathematics, the method of equating the coefficients is a way of solving a functional equation of two expressions such as polynomials for a number of unknown parameters. It relies on the fact that two expressions are identical precisely when corresponding coefficients are equal for each different type of term.

What method is used to obtain the coefficients? ›

To find the coefficient of X use the formula a = n(∑xy)−(∑x)(∑y)n(∑x2)−(∑x)2 n ( ∑ x y ) − ( ∑ x ) ( ∑ y ) n ( ∑ x 2 ) − ( ∑ x ) 2 . To find the constant term the formula is b = (∑y)(∑x2)−(∑x)(∑xy)n(∑x2)−(∑x)2 ( ∑ y ) ( ∑ x 2 ) − ( ∑ x ) ( ∑ x y ) n ( ∑ x 2 ) − ( ∑ x ) 2 .

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Neely Ledner

Last Updated:

Views: 6150

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.