JMM Transcript

in this video we are going to look at how to solve a type of first order differential equation called a separable differential equation so the idea with a separable differential equation is you can essentially separate the terms with Y from the terms with X so imagine that you have a first order equation and perhaps after rearranging terms you can put it in this form where we have dydx here Y is a function of x equals whatever else is over on the right hand side but the idea is that we could separate this into the product of terms with X and terms with Y so here to denote that I have f of x times G of Y typically you'll be looking at actual Expressions here we'll see examples if your differential equation can be written in this way then we can use the technique of separation of variables to try to find the solution to this differential equation what I'm going to do is separate X and Y so I'm going to put everything with Y say on the left hand side I'm going to divide over by G of Y to write 1 over G of Y and leave the d y on the left hand side so that everything to do with Y on the left hand side turns into 1 over G of Y times d y equals put everything with X over on the right hand side that's going to be this f of x expression together with DX okay this is a strange thing to write down because the expression d y d x is not a fraction it's not numerator d y denominator DX like the numbered three-fourths or something like that it's a rate of change however this is a technique it's giving us a way to try to find the solution y as a function of x so what we now do after rearranging our equation so that we've got y on one side and X on the other is we integrate so we'll integrate this left-hand side that's going to be an integral with respect to Y and integrate this right hand side so here we'll be anti-differentiating with respect to Y here will be anti-differentiating with respect to X and then we want to solve for y when we can so if I can then isolate y we'll find an explicit solution to this differential equation this technique is called separation of variables so what I would like to do next is several examples I think maybe four examples so I'll give you four differential equations which may or may not also have initial conditions we will separate the variables we'll anti-differentiate there are certain Expressions that you tend to see if you do separation of variables over and over so we'll we'll see some of those emerge in our examples and then I will wrap up this video with just a brief justification of why this technique is a good idea so this the separating here is a little bit strange because I broke apart the expression dydx but I will essentially use the chain rule to justify that yes this is what we want to do in this situation okay let's start with this example we would like to solve the differential equation d y d x equals x times y so literally the right hand side is x times y so it's a function of x times a function of Y let's separate these so what I'm going to do is divide over by y essentially multiply over by DX so I'll write 1 over y d y equals x DX I personally do not like this kind of expression without also the integration kind of brought into it so I immediately then write the integral symbol in front to me that just looks a lot nicer to have the d y d x in the context of integration now we are going to integrate both sides the left hand side with respect to Y the right hand side with respect to X both of these integrals are indefinite so what I'm going to do just for this one and only time is I'm going to pick up a constant of integration when I do both integrals but then we will realize that we really only ever need one constant of integration when we do the separation of variables okay so what's the antiderivative of 1 over y it's natural log of the absolute value of y Plus throughout today's video what we're going to have are lots of constants of integration and we're going to do algebra on this constants of integration so I'm going to use subscripts to distinguish between the constants I'll talk a little bit more about that at the end but let me just say C1 we need the end of this problem and as we work through examples C1 is the constant I'm picking up right now when I integrate 1 over y with respect to y on the other hand when I take the antiderivative of X with respect to X it's x squared over 2 plus another constant and just to say hey that's another constant I'm going to denote that with C subscript 2. okay but here's the thing is constant on the left constant on the right I would then subtract C1 over from C2 C2 minus C1 is just another constant so there's no need to have two constants here because we can just merge them into one on the right hand side so what I typically would do and what I will do in all future examples is not pick up a constant on the left hand side so normally from here to here I would write natural log of the absolute value of y equals x squared over 2 plus a constant of integration this would normally be my first step after writing down the separation of variables uh because I've got yeah another consonant it's technically C2 minus C1 I'm going to write C3 where the idea here is C3 is C2 minus C1 and again I'm going to address this issue with constants at the end of this problem okay we now would like to solve for y whenever we can and we can do that in this example so I've got natural log of the absolute value of y equals x squared over 2 plus a constant in order to isolate at least the absolute value of y we need to exponentiate both sides so I'm going to raise e to the left hand side and set that equal to e to the right hand side so on the left hand side we will have e to the natural log of the absolute value of y and on the right hand side we'll have e to the x squared over 2 plus C3 and let me keep going to the right by lots of exponents e to something plus something is the product of e to the first term times e to the second term that means that this expression can be Rewritten as e to the x squared over two times e to the C3 like that okay let me pause here and just let you digest what's happened see what you want to do on the next line so go ahead and write the next line then I will come back okay here's where we're going with this exponentiation e and natural log are inverse functions so on the left hand side e to the natural log of absolute value of y is just going to leave us with the absolute value of y on the right hand side there's nothing we want to do to e to the x squared over 2 that's just what it is e to the C3 is just another number so C3 is a number e raised to that is a number so this is just another number let's give that number a name and I'm going to call it C4 so we'll call this C4 so we'll say the right hand side is C4 e to the x squared divided by 2. okay so that is now looking better than where we started we have uh the absolute value of y on the left hand side and I want to solve for just y this is not an unusual thing to see uh whenever you're doing separation of variables sometimes you have 1 over y like this or something similar and you end up with this absolute value by expression in fact we're going to see it again in this this very video so what I want to do is is work through in detail what's going to happen how to address this absolute value and in the future will be a little bit more casual with it okay so let's consider maybe three different possibilities what if Y is let's say zero so let's start with zero Okay so we've got three different situations for y to think of foreign our function that we're trying to look for is ever equal to zero well in that case the absolute value of y is y but more importantly if I look back at my differential equation if Y is ever 0 then the derivative of y with respect to X is also zero we are at what we think of as an equilibrium solution y will stay zero forever so regardless of x if Y is ever zero it stays zero forever so this would be the solution were that the case it would just be y equals zero we could think of that as y equals zero times e to the x squared over 2. it's a bit of a silly thing to write down without this context but there's a reason why when I do that is I want to have the most General representative form for solutions to this differential equations that I can and this is going to fit into that form okay so if y equals here it stays zero forever so what if Y is say on one side of zero what is y is positive I just realized I wanted to make a little note here let me add this that C4 is e to the C3 okay just trying to keep track of my consonants okay got off topic there for a second but let's go back to the question which is what if Y is greater than zero if a solution Y is ever positive then based on our conclusion from the first case we actually know that it's going to be positive forever so when I look at this solution down here and I have the absolute value of y we can say hey you know what this function is always positive and the absolute value of y is just plain old y so writing absolute value is is superfluous that would mean that the solution to this differential equation we've already found it's just plain old y equals this constant times e to the x squared over 2. like that now let's address the third possibility which is what if Y is is negative again based on this equilibrium solution at zero if Y is ever negative it's going to stay negative forever so if I look at the situation where Y is negative then we know that the absolute value of y needs to flip the sine of Y we do that by throwing a negative in front of Y so if Y is negative the absolute value of y is negative 1 times y that makes it positive because Y is negative so now if I come to this left-hand side and replace it with negative y we would say negative y equals the constant C4 e to the x squared over 2. so now if I want to solve for y I'm just going to multiply both sides by negative 1 to get y equals negative C4 e to the x squared over 2 which if you want to you could take this negative C4 and replace that with a new consonant because that's just another number about C5 e to the x squared over 2. okay let me step back for a second and then I will summarize these three cases and we'll just have one form of the solution in all three situations we were able to put the solution Y into the same general expression Y is a constant times e to the x squared over two so here that constant is zero Y is a constant e to the x squared over two where here the constant is positive because we know it's e to a number and that's always a positive expression so here Y is a positive constant times e to the x squared over 2. in this third situation Y is negative that so Y is a negative constant e to the x squared over 2 but in all three situations y was a constant times e to the x squared over 2. so the general form of the solution is going to summarize all three in just one line we'll say the solution is y is a constant times e to the x squared over 2. this is the form of the solution to this differential equation let me make this a little better thank you here C could be zero it could be positive it could be negative it covers all three cases so we'll just say C is any real number okay so that is our solution to this differential equation and again if Y is 0 that just means we choose that leading constant to be zero if Y is going to be a positive solution like in case two this leading constant will be positive if Y is going to be less than zero this leading constant will be negative so what I do is when I get to this part right here and I've got the absolute value of y is this constant times this exponential function I would say you know what let me just drop the absolute values and let the constant absorb the sine of Y so I typically do not go through this whole argument right here if I recognize that positive 0 negative scenarios for y could be absorbed by this leading constant as we have in this example we will see this again when we do the exponential growth equation later I think it's the third example so let's go ahead and set this aside for now and we will do another example of separating variables this second example is an example of an initial value problem so we would like to solve the separable differential equation d y d x equals 3x squared y squared with an initial condition that when X is 1 Y is 4. so often initial conditions are when X is a zero here it's one not that big of a deal we will plug in x equals 1 and y equals 4 into the general form of our solution when we've gotten that so the first thing we need to do is just solve for the general form so let's go ahead and separate this into terms with Y in terms of X I recommend leaving constants on the right hand side with X it's just usually easier that way so I'm going to say 1 over y squared d y equals 3x squared DX and you'll notice that as I wrote that I went ahead and dropped in the integral symbols just because I like to see that all at the same time so we've got y squared on the left 3x squared on the right d y on the left DX on the right anti-differentiate now for the left hand side the antiderivative of 1 over y squared is negative 1 over y this time I'm not going to bother with the constant of integration on the left hand side because it will just absorb everything into the right hand side the antiderivative on the right is X cubed plus our first constant so I'm going to write C1 and any modifications we make to that we'll just rename that constant by changing the subscript okay let's now isolate y so multiply both sides by negative 1. and we'll have 1 over y equals negative X cubed minus C1 which isn't too bad but I'm just doing algebra on C1 to get into the theme of editing constants I'm going to write plus C2 this is optional it's just the choice I'm making here to replace C1 with a negative C1 with a new constant called C2 still trying to isolate y so let's take the reciprocal of both sides of this equation on the left hand side we'll have y and on the right hand side we'll have 1 over Negative X cubed plus C2 at this point we've solved for y so we've got the general form of the solution y equals 1 over Negative X cubed plus C2 uh this solution isn't necessarily going to exist for all values of X in particular if the denominator is over zero this wouldn't be a solution to this differential equation but let's not get too off topic here I just want to show you the the method of separating variables and and finding the general form of the solution that way okay so given this I would like to actually solve an initial value problem so what happens when X is one before the initial value problem Y is 4 when X is 1. so 4 equals 1 over negative 1 plus C2 what I'd like to do here is solve for C2 that's the goal so uh maybe take the reciprocal again so 1 4 equals C2 minus one I'll write it that way this tells me that C2 is 1 plus a fourth so 5 4. okay so now I've got that constant we can go back to this form of the solution and replace this constant now with what we just found so y equals 1 over I'm actually going to switch the order here I just think it looks a little prettier that way so 5 4 minus X cubed and then again just to make it look better I'm going to multiply this fraction by four over four to write that the solution is 4 divided by 5 minus 4X cubed okay let's check that this does indeed solve this differential equation so I'm going to step aside for a second and let you finish writing this down then I'm going to erase everything we can go ahead and verify that when X is 1 Y is 4 divided by 5 minus 4 so 4 over 1 is 4. it satisfies the initial condition but what I'd like to just revisit for a minute is the idea that this solves the given differential equation so let me step away and then I will clear the board and we will check that we really have solved our differential equation okay let's check our work that's one nice thing about solving differential equations like separable differential equations is at the end you can see if you've done the right thing so you can check does this function y equals 4 divided by 5 minus 4X cubed solve the given differential equation we've already verified that when X is 1 Y is 4. so the right hand side of the question that we were given is satisfied but does this also satisfy that d y d x is three x squared y squared so let's differentiate both sides with respect to X that's going to give us the left-hand side that we want to see dydx and on the right hand side if I think of this like quotient rule loading high is 0 minus high D low is negative 4 d low is going to be negative 12 x squared like that all over low low so the quantity 5 minus 4X cubed is going to get squared typically with the quotient rule you don't want to square out the denominator and we don't want to do that here one nice thing about checking your work is that you're allowed to know what you're hoping to land on so I would like to see three x squared y squared so I keep that in mind as I simplify this is 48. so negative 4 times negative 12 is 48 but I know I'd like to have a 3 in there so what is 48 divided by 3 that's 16 let me write 48 as 3 times 4 squared times x squared so normally I wouldn't take the number 48 and write it that way but I know that I'm looking to have that leading three I also think that things are going to get squared okay so 3 4 squared x squared all over the same denominator as before 5 minus 4 x cubed squared and now we've got 3 x squared and then this looks a lot like y like let me write it down here so we'll have 3x squared I'm going to peel those expressions from the numerator out front and then 4 squared over this denominator squared I'm going to write that as the single fraction 4 over 5 minus 4X cubed all that squared but then this expression in here that I'm squaring is literally y so it's up here so we've we've got y back so that this is now 3x squared y squared and that's exactly what we wanted to see that's one thing I wanted to do the other is is I wanted to revisit an issue that I I brought up and then set aside while I was solving the original problem and that is that the solution we have here is not going to be valid for every value of x because we have a denominator which might be zero so let me just mention that we do not want we cannot have 5 minus 4X cubed equal to 0. so that means that we don't want to see 5 4 equal to X cubed or in other words x cannot be the cube root of 5 4. okay given that we were told that at some point for our function X was one that means that the solution we're looking at is going to live to the left of this number so our solution is not valid for all values of x um let's say we're going to take this solution to work for X values less than the cube root of 5 4. let me actually step aside now and let you see the slope field for this differential equation I'm going to add the solution to it so you will see a curve for all X values to the left of the cube root of 5 4. okay for this third example our differential equation is dydx equals 4X cubed divided by y minus sine of Y so let's put all the things with Y on the left hand side it's going to be y minus sine of y d y everything with X on the right hand side that's going to be 4X cubed DX and then in the usual way I'm going to immediately write that we are doing integration okay all right let's just differentiate the left hand side we will have y squared over 2 up plus cosine of Y on the right hand side just x to the fourth plus our first constant first time we see that consonant you know what this is all that we're going to do because we cannot isolate y in this equation I've got y squared I've got cosine of Y I cannot find an explicit solution y equals stuff with X on the right hand side so there's no explicit way to solve for y here this is going to be an implicit solution let me put up um for random choice of of this constant here a picture of all of the points in the X Y plane that satisfy this equation so so the thing is that what is the graph of an equation it's it's a way of visualizing all of the points that make an equation true so here's a snapshot of what that would look like now this is not even a function y is not a function of X and X is not a function of Y however what we can say is that if you were to pick any points on the graph of this equation and you were to use say implicit differentiation to find the slope of the line tangent to the graph of this equation at that point so here we go like here's an example then the slope satisfies that dydx equals 4X cubed divided by y minus sine of Y so this this is like a relationship between X and Y that makes this differential equation true okay let's use separation of variables to revisit a famous differential equation that we've looked at before this is the exponential growth model here I've written it as DP DT equals some parameter K times P where we can think of p as like a population over time so P depends on the independent variable t we've already looked at this equation but I just want to show how it can be viewed as a separable differential equation there's actually no t on the right hand side but that's okay we could think of this as a function of P times the number one or what I'm actually going to do is leave K on the right hand side so let me put p on the left hand side and write 1 over p DP and then K DT foreign to separate it so that we've got everything with p on the left everything with t on the right there's not a lot with t but we have separated this let's do some anti-differentiation on the left hand side we're going to have the natural log of the absolute value of P on the right hand side we'll have K times t plus constant of integration we've seen this kind of expression before so we need to exponentiate both sides e to the let me write that actually before I jump ahead let me just kind of throw in like some Little E's here and here so that's what we're about to do e to the natural log of absolute value of p is just going to leave us with the absolute value of P here e to the KT plus C1 e to all of that can be written as a product e to the KT e to the c one e to the C1 is another number so I could think about as C2 e to the KT right here C2 is e to the C1 similar to the first example where I've got absolute value of p and then I've got a positive or non-negative expression on the right hand side so C2 is non-negative it's actually positive um and then we have an exponential function that's positive but if I were to allow the function P to be 0 or negative that would be okay if I absorbed the sign into that leading constant so I'm going to get rid of the absolute values and say p is about C3 e to the KT where the idea is that C3 is like plus or minus C2 or maybe it's zero depending on the population and this is the general form in fact we usually would write say p of t equals c e to the KT this is our solution it works if the population is positive zero or negative okay let me say now finally what I want you about the constants and that is that throughout the examples today I tried to keep track of whenever I took a constant of integration and I changed it so here I started by calling this constant C1 and then I I did E2 to C1 that's technically a different number so I called that C2 and then here I was saying it's going to be C2 up to sine you know so let me kind of change that into C3 I don't really want to see that subscript if I'm going to say what the general form of the solution to the differential equation is so then once I've got to the end I just like to see C here honestly this is not what I do in my personal life if I am solving this myself I typically just always call the constant C even if I've done a little algebra to it so I would write C and then I would say hey e to the C is just another C so let's just be calling that c that's what I do and you might see that if you are looking at another resource so it's not too unusual to play a little bit loose with the expression C and just say hey it's a consonant let's just call it C um in this video I did want to distinguish between the constants because this is our first time seeing this so um I didn't want to suggest that a number was literally the same if it actually wasn't okay however it's not too unusual to just see see everywhere that there's kind of an unspecified consonant if you will while you're solving such a differential equation okay now let me step aside and I'm going to erase this and we'll come back and I just want to justify this action of separating the variables because there's something a little bit strange about taking dydx or in this case DP DT and splitting apart that expression into two different sides of the equation right so is this kind of breaking apart notion the right thing to do and the answer is going to be yes but what I will will do is show you that if your function satisfies this version like this separated equation then it should satisfy the original differential equation okay suppose that we have a separable differential equation then the separation of variables method that we've looked at in this video is a technique and we hope that we can do the anti-differentiation and and solve for y ideally so that we can say hey this function should be a solution to that differential equation and that should be is what I want to justify here so how do we know that when we break things apart and we anti-differentiate say left hand side with respect to Y right hand side with respect to X then we're actually going to get back a solution to our starting differential equation so let me suppose that y solves the equation that we get after the separation suppose y which recalls a function of x satisfies that if you anti-differentiate 1 over G of Y with respect to y you get the antiderivative of f of x DX to constant okay suppose that y satisfies this because that's what we get when we do separation of variables is we get a function that makes this true it will make the original differential equation true and to see that let's differentiate both sides of this equation with respect to X so we'll have let me start with the right hand side I'm going to do D DX of f of x DX starting with the right hand side because this is easier I'm integrating with respect to X and then differentiating with respect to X so this is going to be an antiderivative of f of x that I'm going to then differentiate so by the fundamental theorem of calculus we know that these are inverse processes so when I anti-differentiate and then differentiate we're just going to get f of x okay so that's the derivative of the right hand side with respect to X foreign side with respect to X is a little bit trickier so let's set up DDX of 1 over G of y d y is a function of x so we're anti-differentiating y to the function of X all of this we could think of as some expression which is a function of Y which is a function of X okay so I've got composition here on the left hand side if I want to differentiate this kind of composition with respect to this innermost variable X It's actually an application of the chain rule so relying on this notation H here let me just write kind of an intermediary step it would be d h d y d x d y d x is actually what we want to see that's the left hand side of our differential equation d h d y now is like saying differentiate this integral expression with respect to Y so I'm going to anti-differentiate with respect to Y then differentiate with respect to Y I'm actually going to get back 1 over G of Y kind of like we did or exactly like we did with the right hand side so 1 over G of Y d y d x but if this is equal and we differentiate both sides with respect to X then their derivatives after differentiation with respect to X should also be equal so put these two lines together and we have 1 over G of Y d y d x equals f of x which we can then bring that g of Y over to say that d y d x satisfies our original differential equation so d y d x is f of x times G of Y okay so that was just a brief justification that this method is a good method