Transcript for:
Solving Second Order Linear Differential Equations

how would you solve an equation that looks like that y double prime minus five y prime plus six y is equal to zero how would you solve that differential equation in this video we're going to talk about it but first you may want to have a sheet of paper with you to take down some notes so we're going to talk about how to solve second order linear differential equations now these type of equations are usually in this form where p of x q of x and r of x are continuous functions now when g of x is equal to zero what we have is a homogeneous linear equation if g of x equals some other number if it doesn't equal zero then we have a non homogeneous equation now when p q and r are constant functions we have this equation a y prime plus b y prime plus y equals i mean plus c y rather equals zero and a typical solution of this equation is in the form y is equal to e to the rx if you take the first derivative of that you're going to get r e to the rx and if you take the second derivative of that you're going to get r squared e to the rx so substituting y y prime and y double prime we get a times r squared eats the rx and then replacing y prime with r ease the rx and then replacing y with just e to the rx so we're going to factor out e to the rx and so we're going to have a r squared plus br plus c is equal to 0. dividing both sides by e to the rx we get this equation ar squared plus br plus c is equal to zero now when we have that equation what we want to do is solve for the value of r there's two things we can do in order to get that done we could factor or we could use the quadratic formula which will be r is equal to negative b plus or minus the square root of b squared minus 4ac divided by 2a now there's three cases that you need to be familiar with when solving for r the first one is when the discriminant b squared minus four ac is greater than zero when that happens you're going to have two real unequal roots or solutions so for example r might be equal to four and r might be equal to negative three so those would be two real roots in this situation you could usually factor uh this quadratic expression when you have the situation the general solution to the differential equation will be y is equal to c one e r one x plus c two e r two x and all you got to do is plug in r1 and r2 into that formula so this would be r1 that would be r2 and that will give you the general solution when dealing with an initial value problem or boundary problem you need to solve for c1 and c2 now let's move on to the second case this is when the discriminant b squared minus 4ac is equal to 0. in this case you get one real root like for example r would equal five but just one answer so the general solution for this equation will be y is equal to c one e to the rx plus c2 x e to the rx so we don't have the subscripts r1 or r2 for this case in the third case the discriminant b squared minus 4ac will be less than 0 or negative in this case you're going to get imaginary numbers or complex numbers so you'll have to use the quadratic formula so r1 and r2 will be in this format you'll have r1 is equal to alpha plus beta times i and r2 is equal to alpha minus beta times i now once you have alpha and beta you could use this formula to write the general solution so it's going to be e alpha times x times c 1 cosine b x or beta x rather plus c 2 beta x so that will be the general solution for the third case now let's go back to this equation y double prime minus five y prime plus six y is equal to zero let's talk about how we can solve this differential equation so first let's write this quadratic function below it a r squared plus b r plus c is equal to zero a is one b is negative five c is six so replacing those values we're gonna have one r squared minus five r plus six is equal to zero now for this quadratic expression we don't need to use a quadratic formula we could simply factor it so we need to find two numbers that multiply to the constant term but add to the middle coefficient so we know two times three is six but adds up to positive five but negative two and negative three it still multiplies to positive six but adds to negative five so we're going to write this as r minus 2 times r minus 3. so we get two real solutions for r so this is case one so now that we have the values of r we can write the general solution so here's the general formula for case one it's c one e r one x plus c two e r two x substitute in r1 let's call this r1 and we'll call that r2 so let's replace r1 with 2 and then let's replace r2 with 3. so this is the general solution to the differential equation that's the answer now let's consider this example y double prime minus six y prime plus nine is equal to zero so once again let's write this formula below it a r squared plus b r plus c is equal to zero a is one b is minus six c is not so now we need to factor this quadratic expression so we need to find two numbers that multiply to 9 but add to the middle coefficient of negative 6. so this is going to be negative 3 and negative 3. so to factor it's going to be r minus 3 times r minus 3. so we can write that as r minus 3 squared which equals zero so we can clearly see that r is equal to three now we have one solution one real solution and so the general solution is going to look like this this is the formula for it y is equal to c1 e to the rx plus c2 x e to the rx don't forget about this x i know i've made that mistake in the past so just remember that it's there we don't need the subscripts r1 or r2 because there's only one r value here so it's going to be c1e replacing r with 3 and then plus c2 x e to the 3x so this right here is the solution or rather the general solution of the differential equation so that's how you could solve it when you have the second case that is when you have one real solution now let's try another example let's say we have nine times d squared y over dx squared and then plus 24 times dy over dx plus 16 is equal to zero so feel free to pause the video and try that problem if you wish if you see it in this form you could put it back into a form that you're more familiar with d squared y dx squared we can just replace that with y double prime d y dx we can replace that with y prime so we have this so now let's write this equation a r squared plus b r plus c is equal to zero so we can see that a is nine b is 24 and c is 16. now notice that 9 and 16 are perfect squares 3 squared is 9 4 squared is 16. so if we take the square root of 9 and the square root of 16 and double it notice that this gives us 24 the middle coefficient when you see that that tells you you have a perfect square trinomial so to factor it it's going to be the square root of 9r squared which is 3r plus the square root of 16 which is 4 squared equals 0. so solving for r we have 3r is equal to negative 4 dividing both sides by three we get one solution r is negative four over three so because we have one real solution this tells us that we have case two now before we write the general solution let's talk about what you could have done if you didn't realize it was a perfect square trinomial so let's say if you wanted to factor that trinomial what you need to do is multiply 9 by 16. so 9 times 16 is equal to 144. now you need to find two numbers that multiply to 144 but add to the middle coefficient 24. so this is going to be 12 and 12. 12 times 12 is 144 but 12 plus 12 adds up to 24. now your next step is to replace the middle term with 12r plus 12r so mathematically the value is still the same 12r plus 12r adds up to 24r next factor by grouping so in the first two terms take out a 3r you'll be left with 3r plus 4. and then in the last two terms take out the gcf which will be 4 in this case so 12r divided by 4 is 3r 16 divided by 4 is 4. the fact that these two are the same tells you that you are on the right track so if you factor out three r plus four you'll be left with three r plus four which is the same as what we have here so now we can write the general solution for case 2. so it's c1 e raised to the rx plus c2 x e raised to the rx so all we need to do is replace our r value which is negative four over three and so this is the answer this is the general solution of the differential equation and as you can see it's not that bad so as long as you know what case you're dealing with and you know which general solution you need to work with once you have your value of r just plug it in and you'll get the answer here's another one that we could try y double prime plus eight y prime plus 25 is equal to zero go ahead and try that one so let's write this formula first we could see that a is equal to 1 b is 8 and c is 25. now to find two numbers that multiply to 25 and at the same time add to eight that's not going to happen so we can't really factor this expression which means we need to use the quadratic formula so r is going to be negative b plus or minus the square root of b squared minus 4ac divided by 2a so we said that b is 8. so we have b squared which is 8 squared of 64 minus 4 times a times c c is 25 a is 1 divided by 2a or 2 times 1 which is 2. so this gives us negative 8 plus or minus now 4 times 25 is 100 and 64 minus 100 will give us negative 36. the square root of 36 is 6. the square root of negative 36 is 6 times the imaginary number i negative 8 divided by 2 is going to give us negative 4 and 6 divided by 2 is three so we get this so we have two equations r one is going to be negative four plus three i while r two is negative four minus three i so now let's get rid of this now once you have the answer in this form you also want to write this expression r1 is alpha plus beta times i r2 is alpha minus beta times i so in this form you could see that alpha is negative 4 beta extreme so let's go ahead and write that now once we have our alpha and beta values we can now find the general solution by the way the fact that we have two complex numbers or two imaginary numbers tells us that we have case number three so the general solution for case number three is this y is equal to alpha times x i mean e raised to the alpha times x and then times c one cosine beta x plus c two sine beta x so let's replace alpha with negative four and then let's replace the beta with three and so this is the final answer for this problem so now you know how to solve a second-order linear differential equation for all three cases now the next example problem that we're going to try is an initial value problem so we have y double prime plus 4y is equal to zero and y of 0 is equal to 4 and y prime of 0 is equal to 6. go ahead and solve this initial value problem so i'm going to rewrite the differential equation like this y double prime plus zero y prime plus four y is equal to zero so we can see that a is equal to one b is zero and c is four so we have r squared plus four is equal to zero subtracting both sides by four that gives us r squared is equal to negative 4. next we need to take the square root of both sides now we know that the square root of 4 is plus or minus 2. so the square root of negative 4 is plus or minus 2i so now we can write the first value of r as 0 plus 2i and the second one is going to be 0 minus 2i so we know that r1 is alpha plus beta i r2 is alpha minus beta i so we can clearly see that alpha is 0 beta is 2. so let's write that here alpha is zero beta is two now our next step is to write the general solution of the differential equation so it's e alpha times x and then c one cosine beta x plus c two sine beta x now alpha is zero so we're gonna have e to the zero e raised to the zero is one so that's just going to disappear so it's going to be one times c one cosine beta x beta is two plus c2 sine beta x and so that is the general solution to this differential equation but because we're dealing with an initial value problem we need to use these two points to get c1 and c2 so at this point we can get rid of everything else so let's plug in this point into this equation so y is four x is zero so we're gonna have cosine two times zero which is zero and then sine of zero times c2 cosine of zero is one sine of zero is zero so therefore we can see that c1 is equal to 4. now let's calculate c2 so we need to use the second point we need to find the derivative of this expression the derivative of cosine 2x is negative sine 2x times the derivative of 2x which is 2. the derivative of sine 2x is going to be cosine 2x times 2. so we have y prime is equal to negative two c one sine two x plus two c two cosine two x so now let's plug in this expression so y prime is six and then sine two x that's gonna be sine zero so that whole thing is 0 plus 2 c 2 cosine of 2 times 0 so this is what we have this disappears we know that cosine 0 is 1 so dividing both sides by 2 c2 is equal to 6 divided by 2 which is 3. so now that we have the values of c1 and c2 let's plug it in into that equation so we're going to have y is equal to 4 cosine 2x plus 3 sine 2x and so this right here is the solution to the initial value problem now let's work on one more problem we're gonna have y double prime minus two y prime plus y is equal to zero and this is going to be a boundary value problem y of 0 is equal to 3 and y of 1 will be equal to 7 times e in the initial value problem in the last problem that we did we had y of 4 is equal to 0 and y prime of 0 is equal to 6. so notice the difference between the initial value problem and the boundary value problem in the initial value problem we have a point in the y function and in y prime in the boundary value problem we have two points in the original function y and so that's how you can quickly distinguish if you're dealing with the initial value problem versus the boundary value problem so now let's go ahead and work on this example problem so let's write a r squared plus br plus c right beneath it so we can see that a is one b is negative two and c is one now we need to factor the trinomial two numbers that multiply to one but add to the middle coefficient negative 2 will be negative 1 and negative 1. so what we have here is a perfect square trinomial and we could see that r is equal to 1. so we have one real solution which means we are dealing with case number two so let's write the general solution to the case number two so the formula is y is equal to c1 e rx plus c2 x times e raised to the rx let's replace r with one so we have c1 e to the x plus c2 x e to the x now our goal is to solve for c1 and c2 using those two points so let's start with the first one let's replace y with three and x with zero so we're gonna have this e to the zero is one and zero times e to the zero times c2 is just zero so we can see that c1 is equal to three now let's use the second point plugging it back into that formula y is seven e c one is three and then it's going to be e to the x x is one plus c two times x which is one and then e to the one so we have seven e is equal to 3e plus c2 times e subtracting both sides by 3e we're going to get 7e minus 3e which is 4e and that's equal to c2 times e dividing both sides by e we can see that c2 is equal to four so now we can write our final answer which i'm going to put it up there so plug in everything into this formula we have y is equal to c1 which is 3 e to the x plus c2 which is 4 x e to the x so this is the solution to the boundary value problem so that's it for this video now you know how to solve second order linear differential equations thanks again for watching