Transcript for:
Solving PDE by Separation of Variables

in the last video we were in the middle of solving our PDE by separation of variables after separating variables in our differential equation we showed that the constant that each side of the equation was equal to cannot be positive or 0 and must be negative in this video we're going to continue solving our PDE given the fact that we now know what sign are constant takes when we have a negative constant we can write that constant as negative lambda squared since squaring any real number will always give you a positive value and so a negative of that Square will always be negative which means our separated differential equation will look something like this we can break up this equation into two separate ordinary differential equations one in terms of T and the other in terms of X if we rearrange the equation in T we'll get DT by DT equals negative lambda squared times capital T which means that capital T is just an exponential function of time this time however that exponential is a decaying exponential instead of one that keeps on rising and blows up to infinity once again we have a as an arbitrary integration constant similarly for the OD e involving X we have d 2 X by DX squared plus lambda squared times capital X equals 0 which means that we can use the very basic rules you learn back in your OD es class and write our solution capital X as B cosine of lambda times X plus C sine of lambda times X where B and C are again arbitrary integration constants instead of getting hyperbolic sines and cosines which is what we got - 2 being a positive constant we now just have regular sines and cosines because the solution to our overall PDE is the product of capital T and capital X you can write you down as a times the exponential of negative lambda Square t times B cosine lambda X plus C sine lambda X let's simplify this equation a bit keeping in mind that a constant times another constant is still a constant so if we multiply by a inside the square brackets we'll have a simpler expression in terms of only two constants which we'll call C 1 and C 2 obviously we aren't done yet we still need to find the values of these by applying the boundary and initial conditions there are three unknowns here C 1 C 2 and lambda and this matches up very evenly with the fact that there are two boundary conditions in one initial condition which I've written here to make things easier let's apply the simplest boundary condition first so when x is 0 Q is also 0 if we do that we can see that the exponential in time cancels out since the Exponential's are never 0 we can also see that the sine term goes away because the sine of 0 is also 0 and since cosine of 0 is 1 what we're left with is that c1 equals 0 so our solution you now is just c2 times the exponential of negative lambda Square t times sine of lambda X now let's apply our second boundary condition so when X is L U is also 0 if we do that we can see that once again the exponential in time cancels out so what we're left with is that as long as c2 is in 0 and we can't make it 0 because then the solution would be trivial then sine of lambda L equals 0 now lettest sine 0 well from basic trigonometry you know that sine is 0 whenever we're taking the sine of an integer multiple of Pi because sine pi is 0 sine 2 pi is 0 and so on it follows then that lambda times L is n times pi so lambda sub n is n times pi over L which means that the solution corresponding to lambda sub n is un equals c2 times the exponential of negative lambda n Square t times sine of lambda sub n times X where n is a positive integer because there are multiple solutions for lambdas since I can pick effectively any positive integer I want for n I'm going to write lambda with the subscript n to show the value of n that particular lambda corresponds to notice that I'm excluding N equals 0 because we said earlier that lambda can't be 0 notice also that I could pick any positive integer I want for N and that would satisfy the PDE in the two boundary conditions in fact I could also take any value of the constant c2 and I would still satisfy the PDE in the tube three conditions as long as my N is a positive integer as a result I have an infinite set of solutions that successfully satisfy the PDE and the two boundary conditions because the PDE and boundary conditions are all linear and homogeneous I could do what I did last time and write my general solution as a linear combination of this infinite set of individual solutions so U is the sum from N equals one to infinity of a n times the exponential of negative lambda N squared times time times the sine of lambda n times X where the ans are just coefficients the uniqueness to this linear combination of an infinite set of solutions comes with applying the initial condition which allows us to find values for the coefficients a sub n but before I do that let's take a short detour remember near the start of the video how we were solving for the function capital X well this is the OD e we were solving and these are the two boundary conditions we had on that spatial variable X this might not look like much but if you remember one of my earlier videos it looks a lot like a sturm-liouville problem so let's recall the sturm liouville theorem which says that if i have a second-order ode ee that can be written in the form of a sturm-liouville equation with these two linear homogenous boundary conditions than the solutions to that boundary value problem for different values of the constant lambda hold a an orthogonality relation given by this integral let's compare the assumptions of the sturm liouville theorem to what we had when solving for capital X in our separation of variables method first we need to check whether the equation we were solving can be considered a sturm-liouville equation and I encourage you to verify that this OD e is indeed a sturm-liouville equation with P of X equal to 1 Q of X equal to 0 R of X equal to 1 and alpha equal to lambda squared so that part's checked now what about the boundary conditions do we have the sturm liouville problem yes because the boundary conditions for our PDE are both linear and homogeneous just like the boundary conditions needed for the sturm liouville theorem and that is why the method of separation of variables requires linear home jannis Calgary conditions which is what I said in the previous video because eventually we want to apply the sturm liouville theorem so that's why we need linear homogenous boundary conditions anyway when we solve this OD e for capital X we got solutions of the form sine of lambda sub n times X there was also a cosine there but that was removed because of the boundary conditions we had now this solution capital X sub n corresponds to a particular eigenvalue lambda sub n specifically the eigenvalue is lambda sub n squared but it doesn't really matter since they're directly related it's possible to write another solution X sub M that now corresponds to a different eigen value lambda sub M so X sub M of X is sine of lambda sub n times X since we now have two solutions to the sturm liouville problem for two different eigenvalues lambda sub n and lambda sub m we can apply the sturm liouville theorem to say that these two solutions are orthogonal on the interval from 0 to L if we plug in our weighting function R of X and our two solutions X sub M and X sub n we get the following integral relation after applying sturm-liouville this might have been obvious to you if you already encountered this relation and integral calculus but I went over sturm-liouville anyway because at some point you're going to encounter more complicated problems where an orthogonal relation isn't immediately obvious and requires application of the sturm liouville theorem such as for Bessel functions I mean you can look these integrals up but if you're solving from scratch sturm-liouville is usually the way to go anyway let's go back to our PDE solution and let's go apply the initial condition so when T is 0 U is Phi of X the exponential of 0 is just 1 so Phi of X is the sum from N equals 1 to infinity of a sub n times sine of lambda sub n times X and this is where the orthogonality relation from the sturm liouville theorem comes in if I multiply both sides by sine of lambda M times X and integrate from 0 to L here's what I end up with the integral from 0 to L of sine of lambda sub n times X times Phi of X DX equals the integral from zero to L of sine of lambda sub M times x times the sum from N equals one to infinity of a sub n times the sine of lambda sub n times X since the integral of the sum of multiple functions is the sum of their integrals we can switch the order of the integration and the summation in which case our expression simplifies now look what happens when n does an equal n well when N and M are both different we can apply the orthogonality relation from the sturm liouville theorem we just derived to conclude that the integral on the right hand side will be 0 the only time the right hand side isn't 0 is when N equals M which means that every single term in the summation will cancel out except when N equals M this ends up hugely simplifying our equation so that now we have the integral from 0 to L of sine of lambda sub M times X times Phi of X equals the integral from 0 to L of a sub M times sine squared of lambda sub M times X if we integrate the sine squared term on the right side we end up with a sub M times L over 2 on the right now if we isolate our coefficient a sub M we get a sub M equals 2 over L times the integral from 0 to L of sine of lambda sub M times X times Phi of X so finally finally we can write down the general solution to our PDE problem that we started working on in the previous lecture and that does it you have now solved a partial differential equation subject to its associated boundary and initial conditions using separation of variables congratulations but there still more left to do for instance what if we had a PDE where the boundary conditions weren't homogeneous we can't use separation of variables in that instance so we'll have to rely on other techniques and that's something we're going to start in the next video I'll see you later