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.

Main content
Current time:0:00Total duration:18:48

Using the Laplace transform to solve a nonhomogeneous eq

Video transcript

it's been over a year since I last did a video in the differential equations play listen I thought I would start taking up making a couple of videos and I think where I left off I said that I would do a non-homogeneous linear equation using the Laplace transform so let's do one is a bit of a warm-up now that we've had a or at least I've had a one year hiatus maybe you're watching these continuously so you're probably more warmed up than I am so if we have the equation the second derivative of y plus y is equal to sine of 2t and we're given some initial conditions here the initial conditions are Y of 0 is equal to 2 and Y prime of 0 is equal to 1 and where we left off and now you probably remember this you've probably recently watched the last video to solve these we just take the Laplace transforms of all the sides we solve for the Laplace transform of the of the function then we take the inverse Laplace transform if that doesn't make sense then let's just let's just do it in this video and hopefully the example will clarify all confusion so in the last videos either the last one in the previous when I showed you that the Laplace transform the Laplace transform of the second derivative of Y is equal to s squared times the Laplace transform of Y and we keep lowering the degree on s so minus s times y of 0 you can kind of think of it as taking the derivative this is an integral it's not exactly the antiderivative of this but the Laplace transform it is an integral the transform is an integral so Y of 0 is kind of a you know one derivative away from that and then minus y prime of 0 and then we could also write rewrite this and this is a purely notational issue I could write this instead of you know instead of writing applause transform of Y all the time I could write this as x squared times Capital y of s because this is going to be a function of s not a function of Y minus s times y of 0 minus y Prime zero these are going to be numbers right these aren't functions these are the the function evaluated at zero or the function evaluated or the derivative of the function evaluated at zero and we know what these values are Y of zero right here is two and Y prime of zero is one it was given to us so if we take the Laplace transforms of both sides of this equation first we're going to want to take the Laplace transform of this term right there which we've really just done the Laplace transform of the second derivative is s squared times the Laplace transform of the function which we write as capital y of s minus this minus 2's they gave us that initial condition minus 2's and then minus one right this term right here is just 1 so minus 1 so that's term right there we then we want to the Laplace transform of Y by itself so this is just plus y of s right the Laplace transform of Y so I'll just rewrite the Laplace transform of Y I'm just rewriting it in this notation Y of s it's good to get used to either one and then we want to take this is going to be equal to the Laplace transform of sine of 2t and we showed you in a video last year of what we showed what the Laplace transform of sine of a T is but I'll write it down here just so you remember it Laplace transform that's the sign of a T is equal to a over s squared plus a squared right a over s squared plus a squared so the Laplace transform of sine of 2t here a is two this is going to be 2 over s squared plus four so if we take the Laplace transform of both sides of this the right hand side is going to be 2 over s squared plus 4 now what we can do is we can separate out all the Y s terms and so we can factor well I guess we can say factor out their coefficients so that's the Y of s term that's the Y of s term and so we could write the left-hand side here as s squared that's that term plus one the coefficient on that term x squared plus one times y of s let me do it in green so this is y of s and this is y of s times y of s and then we have the non Y of s terms these two right here so minus two s minus 1 is equal to 2 over s squared plus 4 we can add 2 s plus 1 to both sides to essentially move this to the right hand side and we're left with we are left with s squared plus 1 times y of s times y of s is equal to 2 over s squared plus 4 plus 2 s plus 1 now we can divide both sides of this equation by s squared plus 1 and we get the Laplace transform of Y y of s is equal to 2 let me switch colors it's equal to 2 over s squared plus 4 times this thing right here I'm dividing the whole both sides of this equation by this term right there so times s squared plus 1 it's in the denominator so I'm dividing by it plus 2 s plus 1 I have to divide both of those terms by the s squared plus 1 divided by s squared plus 1 divided by s squared plus 1 now in order to be able to take the inverse Laplace transform of this I need to get it in some type of simple fraction form these are actually easier to do but this one's a little bit difficult I want to do some partial fraction decomposition to break this up into maybe simpler fractions and since both of these so what I want to do I'm going to do a little bit of an aside here and this really is the hardest part of these problems is to is the algebra breaking this thing up so since we're going to break this up I'm going to break this up so let me write this this way 2 over s squared plus 4 times s squared plus 1 I'm going to break this up into two fractions this is the partial fraction decomposition one fraction is s squared plus 4 and then the other fraction is s squared plus 1 and since both of these both of these denominators have a are of degree two the numerators are going to have they're going to be of degree one so they're going to be some let me write it this way a this one will be a s plus B and then this one will be C S Plus D and this is just pure algebra here this is just partial fraction decomposition I've made a couple of videos on it and I'm saying that I'm assuming that this expression right here can be broken up into two expressions of this form and now I need to solve for a B C and D so let's see how we can do that so if we were to if I were to start with these two and add them up what do I get I would have to multiply these times so my denominator my common denominator would be this thing again it would be s squared plus 4 times s squared plus 1 and now I'm going to have to multiply the a s plus B a s plus B times this s squared plus 1 times s squared plus 1 this as it's right now if these two terms would cancel out you'll just get this term but I need to add it to this right here so you get plus C S Plus D times this term right here times s squared plus 4 and now let's see what we could do to match up the terms here with this number 2 right here so let's multiply all of this out so a s times s squared a s times s squared is a s to the third a s times 1 is plus a s B times s squared so plus B s squared and then you have B times 1 is plus B and then you have C s times s squared that's c s to the third c s to the third and then CS times four so it's plus four CS and then let's see these are these are these problems are tiring okay and then and I also have a cold so this is especially tiring but I'll soldier forward where was I so I've multiplied the C's times each of these I have to multiply the D so plus D s squared that's d times that one plus D times 4 so plus 4 D so that's all of them and I just showed it this way so I have the the common degree terms under each other so if I were to add the entire numerator I get and I'll just switch colors somewhat arbitrarily I get a plus C times s to the third plus let me write the S squared term next plus B plus D times s squared and I'll write this S term plus a plus 4c times s plus B plus 4 D this is just the numerator this is what I just added these two things up this whole thing up here simplifies to this I don't know if the word simplifies is appropriate but it becomes this expression right here and that's just the numerator the denominator is still what we had written before the denominator is still d s squared plus 4 times the s squared plus 1 of course I have to show that this is a fraction and this is going to be equal to this thing over here 2 over s squared plus 4 times s squared plus 1 now whatever why did I go through this this whole mess right here well the reason why I went through it is because we should be able to solve for a B C and D so let's see a plus C this is the coefficient on the S cubed term do we see any s cubed terms here no we see no s cubed terms here so a plus C let me write this down a plus C must be equal to zero because we see nothing here that has an S to the third B plus D is a coefficient on the x squared term do we see any s squared terms here no so B plus D must be equal to zero B plus D is equal to zero a plus 4c a plus 4c our there's our the coefficient of the S term I see no s term over here so a plus 4c a plus for C must also be equal to zero and then finally finally we look at just the constant terms and we do have a constant term on the left-hand side of this equation we have two so B plus four D didn't want to make it that thick B plus four D must be equal to two must be equal to two so let's see if we can do any so this it seems like these linear equations are pretty easy to solve for let's subtract let's subtract this from this so a or let me subtract the bottom one from the top one so a minus a that's zero a and then C minus four C minus 3 C is equal to zero and so you get c is equal to 0 if C is equal to zero a plus C is equal to zero a must be equal a must be equal to zero now let's do the same thing here let's subtract this from that so you get B minus B is 0 and then minus 3 D that's just D minus 40 and then 0 minus 2 is equal to minus 2 and then you get D is equal to D is equal to what do we get d is equal to 2/3 D is equal to 2/3 right minus 2 divided by -3 is 2/3 and then this this isn't a minus here I wrote that there later we said B plus D is equal to 0 so B must be the opposite of D right we could write B is equal to minus D or B is equal to minus 2/3 let's remember all of this and go back to our original problem because we we've kind of solo actually let me just be clear so we can rewrite to over s squared plus four times s squared plus one we can rewrite this as well a is 0 B is minus two-thirds so this is equal to minus two-thirds over s squared plus four and then C is zero we figured that out and then D is two-thirds so plus two-thirds over s squared plus one so all of that work that I just did that was just to break up this piece right here that was just to break up that piece right then of course we have these other two pieces here that we can't forget about so all of after all of this work what do we have and I'm going to make sure I don't make a careless mistake here we get we get our double plus transform of Y as you can see the algebra is the hardest part here is equal to is equal to this first term I'm just going back this first term which I've now decomposed into this into this so it's minus let me write it this way minus one-third and I think you're going to see in a second why I'm writing this way minus one-third times 2 over s squared plus 4 and then plus 2/3 plus 2/3 times 1 over s squared plus 1 and you probably saying Sal while you're writing it this way well you can already immediately see that this is going to be this is a Laplace transform of sine of 2t this is a Laplace transform of sine of T so I wanted to write this 2 here because this is 2 this is 2 squared this is 1 this is 1 squared so I wanted to write it in this form this was just the first term we had two more terms to worry about we don't want to be careless mistake I have 2 s over s squared plus 1 so let me write that down so plus plus two times two times s over s squared plus one plus last one plus one over s squared plus one plus one over s squared plus one now we just take the inverse Laplace transform of the whole thing and then we'll know what Y is let me just write so you know just just as a just to remember the Laplace transform so this is going to be a little inverse it's going to be sine of 2t let me just write just so we have it here so you know I'm not doing some type of Voodoo the Laplace transform of sine of a t is equal to a over s squared plus a squared and the Laplace transform of cosine of a T is equal to s over s squared plus a squared let's just remember those two things when we take the inverse Laplace transform of both sides of this equation the inverse Laplace transform of the Laplace transform of Y well that's just Y this root Y maybe I'll write it as a function of T is equal to well this is the Laplace transform of sine of 2t you can just do some pattern matching right here right if a is equal to two then this would be the Laplace transform of sine of 2t so it's minus one-third times sine of 2t plus two-thirds times this is the Laplace transform of sine of T if you just make a is equal to one sine of T is Laplace transform is one over s squared plus 1 so plus 2/3 times the sine of T let me do the next one in blue just because it was already written in blue plus two times this is the Laplace transform of cosine of T if you make a is equal to 1 then the cosine T Laplace transform is s over s squared plus 1 so 2 times cosine of T and then one last term Plus this is just like this one over here this is just a little plastron form sine of T plus sine of T and we're almost done we're essentially done but there's a little bit more simplification we can do I have 2/3 times the sine of T here and then I have another one sine of T here so I can add the 2/3 to the 1 right what's 2/3 + 1 or 3/3 it's 5/3 so I can write Y of T is equal to minus 1/3 sine of 2t plus these two terms I'm just going to add up plus 5/3 sine of T and then I have this last term here plus 2 cosine of T so this was a hairy problem a lot of work and we saw the hardest part really was just the partial fraction decomposition that we did up here and not making any careless mistakes but the end we got a pretty neat answer that's not too complicated that satisfies this non-homogeneous non-homogeneous differential equation we were able to incorporate the boundary conditions as we did it anyway hopefully you found that vaguely vaguely satisfying it was a good warm-up after a year of no differential equations