# 2nd order linear homogeneous differential equations 2 | Khan Academy

I’ve spoken a lot about second
order linear homogeneous differential equations in
abstract terms, and how if g is a solution, then
some constant times g is also a solution. Or if g and h are solutions,
then g plus h is also a solution. Let’s actually do problems,
as opposed to help you get confused. So let’s say I have this
differential equation, the second derivative of y, with
respect to x, plus 5 times the first derivative of y, with
respect to x, plus 6 times y is equal to 0. So we need to find a y where 1
times its second derivative, plus 5 times its first
derivative, plus 6 times itself, is equal to 0. And now, let’s just do a little
bit of– take a step back and think about what kind
of function– if I have the function and I take its
derivative and then I take its second derivative,
most times I get something completely different. Like, if y was x squared, then
y prime would be 2x, and y prime prime would be 2. And then to add them together
you’d say, well, how would my x terms cancel out so that
you get 0 in the end? So draw back into your brain
and think, is there some function that when I take its
first and second derivatives, and third and fourth
derivatives, it essentially becomes the same function? Maybe the constant in front of
the function changes as I take the derivative. And if you’ve listened to a
lot of my videos, you’d realize that it probably is what
I consider to be the most amazing function
in mathematics. And that is the function
e to the x. And in particular, maybe e to
the x won’t work here– or you can even try it out, right? If you did e to the x,
it won’t satisfy this equation, right? You would get e to the x, plus
5e to the x, plus 6e to the x. That would not equal to 0. But maybe y is equal to e to
some constant r, times x. Let’s just make the assumption
that y is equal to some constant r times x, substitute
it back into this, and then see if we can actually solve
for an r that makes this equation true. And if we can, we’ve found the
solution, or maybe we’ve found several solutions. So let’s try it out. Let’s try y is equal to
e to the rx into this differential equation. So what is the first
derivative of it, first of all. So y soon. prime is
equal to what? Derivative chain rule. Derivative of the inside is r. And then derivative of
the outside is still just e to the rx. And what’s the second
derivative? y prime prime is equal to
derivative– r is just a constant– so derivative of the
inside is r, times r on the outside, that’s r squared,
times e to the rx. And now we’re ready to
substitute back in. And I will switch colors. So the second derivative, that’s
r squared times e to the rx, plus 5 times the first
derivative, so that’s 5re to the rx, plus 6 times our
function– 6 times e to the rx is equal to 0. And something might already be
surfacing to you as something we can do this equation
to solve for r. All of these terms on the left
all have an e to the rx, so let’s factor that out. So this is equal to e to the rx
times r squared, plus 5r, plus 6 is equal to 0. And our goal, remember, was to
solve for the r, or the r’s, that will make this true. And in order for this side
of the equation to be 0, what do we know? Can e to the rx ever equal 0? Can you ever get something to
some exponent and get 0? Well, no. So this cannot equal 0. So in order for this left-hand
side of the equation to be 0, this term, this expression
right here, has to be 0. And I’ll do that in
a different color. So we know, if we want to solve
for r, that this, r squared plus 5r, plus
6, that has to be 0. And this is called the
characteristic equation. This, the r squared plus 5r,
plus 6, is called the characteristic equation. And it should be obvious
to you that now this is no longer calculus. This is just factoring
a quadratic. And this one actually is fairly straightforward to factor. So what is this? This is r plus 2, times r
plus 3 is equal to 0. And so the solutions of the
characteristic equation– or actually, the solutions to this
original equation– are r is equal to negative 2 and
r is equal to minus 3. So you say, hey, we found two
solutions, because we found two you suitable r’s
that make this differential equation true. And what are those? Well, the first one is
y is equal to e to the minus 2x, right? We can call that y1. And then the second solution
we found, y2 is e to the– what is this?– r is minus 3x. Now my question to you
is, is this the most general solution? Well, in the last video, in
kind of our introductory video, we learned that a
constant times a solution is still a solution. So, if y1 is a solution, we also
know that we can multiply y1 times any constant. So let’s do that. Let’s multiply it by c1. That’s a c1 there. This is also going
to be a solution. And now it’s a little bit
more general, right? It’s a whole class
of functions. The c doesn’t have to just be
1, it can be any constant. And then when you use your
initial values, you actually can figure out what
that constant is. And same for y2. y2 doesn’t have to be 1 times
e to the minus 3x, it has to be any constant. And we learned that in the
last video, that if something’s a solution,
some constant times that is also a solution. And we also learned that if we
have two different solutions, that if you add them together,
you also get a solution. So the most general solution to
this differential equation is y– we could say y of x, just
to hit it home that this is definitely a function of x–
y of x is equal to c1e to the minus 2x, plus c2e
to the minus 3x. And this is the general
solution of this differential equation. And I won’t prove it because the
proof is fairly involved. I mean, we just tried
out e to the rx. Maybe there’s some other wacko
function that would have worked here. But I’ll tell you now, and you
kind of have to take it as a leap of faith, that this is
the only general solution. There isn’t some crazy outside
function there that would have also worked. And so the other question that
might be popping in your brain is, Sal, when we did first order
differential equations, we only had one constant. And that was OK, because we
had one set of initial conditions and we solved
for our constants. But here, I have
two constants. So if I wanted a particular
solution, how can I solve for two variables if I’m only given
one initial condition? And if that’s what you actually
thought, your intuition would be correct. You actually need two initial
conditions to solve this differential equation. You would need to know,
at a given value of x, what y is equal to. And, maybe at a given
value of x, what the first derivative is. And that is what we will
do in the next video. See

### 95 thoughts on “2nd order linear homogeneous differential equations 2 | Khan Academy”

• October 11, 2008 at 12:39 am

Amazing!

• January 22, 2009 at 4:28 pm

• February 4, 2009 at 2:02 pm

u er really awesome

• February 16, 2009 at 3:06 am

I have a question.
If b^2-4ac less than 0, what is the solution of the differential equation?

• May 23, 2009 at 1:47 am

Yea, you can also find the solution for Y if you use eigenvalues and eigenvectors. But thnks to you Sal, Everything starts to make sense. I just need a geometric meaning behind them so I can imagine ways to apply them to the real world.

• June 7, 2009 at 4:30 pm

Damped Harmonic Motion.

• July 25, 2009 at 11:58 pm

Yea man, I need that for my electrical engineering course. That stuff comes in handy.

• September 16, 2009 at 11:28 am

wow man thank you very much now i dont have to drop my course XD

• October 16, 2009 at 4:23 am

solo las matematicas tienen el carater universal de ser entendidas …

• October 26, 2009 at 4:07 am

Thank you for your videos! I now have hope that I can understand this.

• December 10, 2009 at 9:53 am

I love u man ! u explain it all thx ðŸ™‚ now i even know why we solve 2nd order ode like quadratic equation

• December 17, 2009 at 11:13 am

something says its negative 5 y i dunno of im correct can yu jus chek it up tq regards

• December 29, 2009 at 1:48 pm

Sal !!! YOU !!! are The Shit!…

In the best way of course XD

• April 28, 2010 at 2:13 pm

is it possible for u to post a video about series solutions? thank you

• May 14, 2010 at 7:15 pm

Quite common to describe oscillations in physics and engineering.

• July 11, 2010 at 10:38 pm

How the fuck can this man explain in 5 minutes what a PAID university professor couldn't in one hour?
You sir, are a God among mortals.

• October 6, 2010 at 4:06 am

This guy is a real teacher, you will probably get me though Diff. Eq! My teacher here at Texas A & M is not very good at teaching, he seems to go on the whole memorization concept. I have always hated memorization, because it makes no sense to me (being an Engineer). This video put the whole idea into perspective, and I no longer need to memorize, but simply approach these problems with actual knowledge. Thanks! Thanks! Thanks!

• November 20, 2010 at 9:08 am

I can never thank you enough, but I will try: thanks * lim(x -> 0) 1/x

• March 7, 2011 at 12:58 am

seriously, i learned an hour of university maths lectures in under 20 mins.

• March 17, 2011 at 12:07 am

i dont understand y u chose e^x…my teacher told me its trial and error to find a solution…which is very time consuming…can i always use e^x?

• April 18, 2011 at 1:38 am

i love the structure of your videos. many professors with math degrees can't even formulate a sentence as clearly as your whole 9 minute videos

• May 28, 2011 at 2:49 pm

I think…no, I'm pretty sure you just helped me pass my math exam… and I think I love you!

• June 2, 2011 at 5:03 pm

I WANNA HUG U RIGHT NOW !

• October 2, 2011 at 1:37 am

omg, everything comes together with your videos i swear. Thank you so much c:

• October 4, 2011 at 4:35 am

I have to agree with most of these comments. For some reason college math professors don't know how to teach the material. You do a much better job,thanks.

• November 4, 2011 at 12:15 pm

Khan does a good job explaining

• January 26, 2012 at 4:07 pm

@Casowsky Better take the abs. of x, otherwise it could be -infinite when approaching to 0 from the left ðŸ˜‰ xddddddddddddddd

• March 5, 2012 at 11:50 am

another solution would have been y(x)=C*e^(x)+V*e^(-6x)

• July 4, 2012 at 10:10 am

WAY more clear than my text book.

• July 18, 2012 at 7:12 pm

you're like the Bob Ross of differential equations lectures :).

• October 26, 2012 at 7:43 am

Perfectly clear now! Hahaha. Thank you!

• November 26, 2012 at 5:09 pm

• December 22, 2012 at 2:12 pm

Thanks so much for d video.. It helped me understand how to solve such type of diff. eqns…. One thing would like to suggest is,if u can show the graphical variation of the eqn. it would help even more… Thanx pal once again.

• January 16, 2013 at 8:20 pm

you are the only thing getting me through my physics degree!! come teach at Bristol!!!

• February 3, 2013 at 1:12 am

What is this e^x sorcery??

• March 28, 2013 at 12:13 pm

Hi, at the end of the video you said that you wonâ€™t prove the general solution, but please can you prove it! I really want to know!

• March 29, 2013 at 2:06 pm

Its a great feeling when you are actually understanding math! I have to thank you for that.

• April 17, 2013 at 4:52 pm

thank you so much ðŸ™‚

• April 25, 2013 at 2:44 am

Why the hell am I paying for university when you teach a hell of a lot better than my lecturers haha. Thanks for the video!

• May 23, 2013 at 3:59 pm

also there's something known as adblock plus out there
look it up

• June 17, 2013 at 10:58 am

So I got this thing in a test: y" + 2 y' + 2y = 0. I couldn't solve r^2 + 2r + 2 = 0. The answer turned out to be: y = C1e^-x cos(x) + C2e^-x sin (x)…
Could someone explain this? Thank you in advance ðŸ™‚

• June 19, 2013 at 3:20 pm

The roots of r would be (-1 + i) and (-1 – i), so try subbing those into the values of r, then writing it in an alternative form involving cosx + isinx

• August 14, 2013 at 1:57 pm

football?

• November 25, 2013 at 11:27 pm

Never stop what you doing bro, you can't even begin to imagine the impact of your videos….Thank you!!

• December 29, 2013 at 1:09 am

the pq-formula is very good here

• May 24, 2014 at 9:04 pm

is this guy a god?

• October 1, 2014 at 9:28 pm

This is a poor example!!!!! Solve like you see it in a text book!!!!!!!!!!!!!

• October 24, 2014 at 10:39 am

One "general" question: Why bother calculating the general solution, when the solution y1 already solves the ODE?

• November 11, 2014 at 1:27 pm

Kudos Sir….Such a great explanation I ever heard on 2nd order homogeneous diff eq'n…Thanks a lot.

• November 13, 2014 at 1:17 pm

Sir what difference would it make if this equation was equal to 10cosx instead of 0?

• February 26, 2015 at 1:50 am

You are so clear and easy to understand lol

• May 12, 2015 at 2:02 am

Great video

• July 19, 2015 at 1:56 am

So the 'e' that randomly works its way into textbook solutions isn't based on black magic?

• July 25, 2015 at 9:02 pm

Wow, that's an amazing explanation, thanks!
But since we have two consonants for a second-order ODE, doesn't it mean that the solution is the most general?

• August 25, 2015 at 7:44 pm

Excellent video Sal!

• September 23, 2015 at 2:21 am

what about y = sinh(rx) + cosh(rx) ?
It looks uglier, but it should still yeild results for r = -3, r = -2, and r<=-17

• September 23, 2015 at 2:31 am

ok. I apologize again. You're right. cosh(rx) + sinh(rx) simpifies to e^rx.

• October 19, 2015 at 8:16 am

This just saved my damn life. Why haven't I been watching khan academy? My professor is terrible..

• January 5, 2016 at 10:50 am

I feel proud that salman khan is indian….

• March 24, 2016 at 1:49 am

Great vid but I'm still gonna fail this Calc 2 test tomorrow. Pray for me please.

• June 15, 2016 at 2:29 pm

So why don't we have to do the wronskian to confirm that the determinant of y1 and y2 and their respective first derivatives doesn't equal zero?

• July 13, 2016 at 9:14 pm

I love you.

• August 17, 2016 at 6:44 am

Thanks a lot for this amazing video sir.

• October 11, 2016 at 5:05 pm

u are jebus

• October 15, 2016 at 11:13 pm

I've only had one math teacher in the last 5 years, and that was Sal Khan

• October 16, 2016 at 4:46 pm

y=0 will also be solution considering the case that not only e^ (cx) would be the solution

• October 23, 2016 at 5:56 pm

It's incredible. I go to the university just to not reprove by lack of presence, because I can't understand anything is taught there. And suddenly has this guy that don't speak my native language (portuguese) and I can understand everything.
There is something wrong with the traditional system…

• February 6, 2017 at 12:07 am

Two weeks I have been struggling with these and now eight minutes later I understand!

• March 12, 2017 at 2:25 pm

This is why!! I am so angry at my teacher for saying to just accept it and not question it because it's "Not something we need to know at this stage"!! Well, if we didn't need it then, riddle me this, why did I get like 1 mark on my homework???

Anyway, great video!

• May 1, 2017 at 4:56 pm

studying for my EIT exam. THANK YOU THANK YOU THANK YOU

• June 3, 2017 at 3:01 pm

As an engineer, I can say you never gonna use this in your life after uni.

• July 20, 2017 at 5:39 pm

did we skip solving first order linear differential equations?

• August 11, 2017 at 5:47 pm

Hey Aru ðŸ˜›

• September 1, 2017 at 6:22 am

Scientist have discovered that….In this world 11 out of 688 people are fool…jklol ðŸ™‚

• September 14, 2017 at 1:57 pm

Why did we considered 'y' as 'e' power 'mx' ?

• October 28, 2017 at 7:16 pm

Why don't we assume that y=a^x ?

• October 28, 2017 at 11:22 pm

I just realize I can use this technique to solve first order differential equations too. Cool!

• December 20, 2017 at 8:09 pm

Thanks a lot for the videos. They are indeed helpful.

• January 20, 2018 at 6:27 pm

Sir how can we apply for deriving damped oscillation equation

• March 13, 2018 at 5:43 am

Why wouldn't -infinity also be a value for r? When I set e^(rx)=0 and solve for r I find that r=-infinity.

• May 3, 2018 at 9:54 am

what about non homogeneous differential equations ?

• May 14, 2018 at 10:55 am

Khan is just bettee than any college teacher. Period.

• August 1, 2018 at 8:18 am

Amazing..

• November 21, 2018 at 10:33 am

At 2:58,why is it not RXE^RX, but just RE^RX?

• November 24, 2018 at 11:36 pm

OOOOOOOHHHH GET IT NOW

• January 21, 2019 at 12:06 pm

why do we have to add y1 and y2 to form y(x) cant we just use either one and still have a solution such as y(x)=y1

• February 21, 2019 at 3:15 am

This is so simple! My ODE professor made this seem so over-complicated! Thank you Sal!!!

• March 10, 2019 at 4:35 am

I got it but why e^x!? what is the purpose??

• March 27, 2019 at 11:57 am

Khan never stop making videos. I will pay for them if I have to. You have helped me so much you have no idea. THANK YOU!!!! Universities should just play your videos instead of a lecture. I would learn 100 times more. That's not even an exaggeration.

• April 14, 2019 at 9:55 am

Thank you sir….u are helping all of us who are not able to clear their concept… Thank-you to your team…

• May 2, 2019 at 3:07 pm

Wow I wish Maths was thought this way everywhere