If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Differential equations

### Course: Differential equations>Unit 2

Lesson 3: Method of undetermined coefficients

# Undetermined coefficients 4

Putting it all together! Created by Sal Khan.

## Want to join the conversation?

• Hello! I'm an engineering student and had an exam with an undetermined coefficients exercise I couldn't solve using this method. Can you help me noticing where I went wrong?

Problem was: y'' + 4y = sin(2x)

I went ahead and predicted the solution in the form of Asin(2x) + Bcos(2x). I figured the 1st and 2nd derivative, and replaced them in the equation:

(-4Asin(2x) - 4Bcos(2x)) + 4(Asin(2x)+Bsin(2x)) = 1sin(2x) + 0cos(2x)

Since all the A's and B's even out, I can't get past this. Thanks! •  Always start by solving the homogeneous equation of the differential equation;y'' + 4y = 0 which has solutions of y_h = c_1cos(2x) + c_2 sin(2x)

Then start by assuming the particular solution as you mentioned:
y_p = Asin(2x) + Bcos(2x),
however this will not work because both predicted solutions are homogeneous solution. Similar to when you have repeated roots you need to multiply each function by x, so the predicted solution should be
y_p = Axsin(2x) + Bxcos(2x)
• How about the topic of variation of parameters? • what if we had (e^2x)*(sin2x)*(4x^2) on RHS? • Hi I am a first year Applied Mathematics student. This is really helpful so thanks so much for that. I was really wondering what you would do if you had xsinx on the right hand side as opposed to simply some constant multiplied by the sinx? Thanks so much. This is coming from South Africa • In that case the easiest way to go about it is:
Realize that x is a polynomial like X^2
So the solution for a differential equation for it will be X+C
and for sin x you know its= Asinx+BcosX so multiply the two.
you get a function that might work . Am not sure.
On second thought
The best way to generalize it is that When you have a non-homogeneous equation the particular solution is usually A constant times the function + another Constant times the function's derivative+another other constant times the next derivative until you reach a constant-0- or until you stop getting new euaton forms like in trig. functions then combine like terms and turn any constant you might get to letters. This is the general form of the particular equation And if you look back that rule works.
so for Y=xsinx
Y'=sinx-xcosx
y''=cosx-cosx+xsinx
you can keep deriving for fun, combine the like terms and you will see that the particular solution is of the form : Axsinx+Bxcosx+Dsinx+Ecosx
Hopefully that works. i should go try it out and get back....
LONG WINDED! SORRY!
• Where can I find the "next video" with another method for solving nonhomogenous d.e. mentioned in ? • how we can integrate e^x/1+e^2x
(1 vote) • You need to use trigonometric substitution, to know what trigonometric substitution to use you need some practice, since this integral has the form `a + x^2`, we need to use the following substitution:
`e^x = tan(θ)`
And we need to get the differential of this substitution, so we derivate both sides:
`e^x dx = sec^2(θ) dθ`
And now we substitute this into the integral:
``⌠     e^x         ⌠   sec^2(θ)        ⌠ sec^2(θ)| ―――――――――― dx = | ―――――――――――― dθ = | ―――――――― dθ = ∫dθ = θ + C⌡ 1 + e^(2x)      ⌡ 1 + tan^2(θ)      ⌡ sec^2(θ)``

After using the trigonometric identity `1 + tan^2(θ) = sec^2(θ)` the integral simplifies a lot, and we get our first result `θ + C`.
Now we need to go back to our original substitution and solve for `θ`.
``e^x = tan(θ)arctan(e^x) = arctan(tan(θ))arctan(e^x) = θ``

And with this we get the final solution:
``⌠     e^x| ―――――――――― dx = arctan(e^x) + C⌡ 1 + e^(2x)``
• What if we were to go simple, such as: y''-10y'+25y=30x+3?? I end up with three variables and i do not know of a way to solve it.
(1 vote) • General solution is:
Yg = C1*e^(5x)

Consider that the particular is a polynomial of the form:
Yp = Ax + B
Yp' = A
Yp" = 0

0 - 10A + 25(Ax+B) = 30x + 3
25Ax -10A+25B = 30x + 3
Therefore you get two equations with two variables:
| 25A = 30
| -10A+25B = 3
solved is...
| A = 30/25 = 6/5
| B = 3/5

So the particular solution is...
Yp = (6/5)x + 3/5
• So after watching the whole series on undetermined coefficients, I'm still stumped by (and this may be silly) the special case where g(x) is equal to a constant (not a constant function, just a constant). What form does the particular solution take when the equation looks like y'' - 3y' -4y = 6?

I have a feeling the answer is very simple, but I can't find a concrete answer. Thank you in advance!   