 Welcome back, everyone. In the previous video, we saw an example of a linear first order, the first order differential equation here. And we saw how to solve it using this technique of integrating factors. And so what I want to do right now is summarize exactly, how does one solve a linear first order differential equation using the technique of integrating factors? And we'll do some examples of this. So every linear differential equation could be solved using the following six steps, A through F right here. The first step is to put the linear differential equation in its standard form. It should look like y prime plus some function times y is equal to some function of x, right? So p of x times y equals q of x, like so. Put in the standard form. It'll often be there for you, but you might have to put in standard form like we did at an example. Then the next thing you do is you're going to calculate the integrating factor i of x. i of x is going to be an anti-derivative of p of x. So this is the coefficient of y when it's in standard form. And raise that anti-derivative to a power of e. And so once you have the integrating factor, you're going to multiply each side of the differential equation by the integrating factor. Now, so you're going to multiply the right side by i of x. Simplify what that is. And then on the right, on the left-hand side, you also times by i of x. Now when you distribute i of x through on this equation, you're going to recognize that the left-hand side is going to look like the product rule. It's going to look like the product rule. And as such, you're going to factor the left-hand side as the derivative of i of x times y. Then you're going to integrate both sides because this thing will look like you'll have the derivative of i of x, y with respect to x. On the right-hand side, you'll have a q of x times an i of x. And so then you're going to integrate both sides. You're going to integrate d of i, y is equal to the integral of q of x times i of x dx. And then the left-hand side will always become i of x, y. The right-hand side was something, right? In which case, the software will all you have to do is divide both sides by i of x. It is simple and amazing, this integrating factor. How convenient it is, how simple it is. And this comes back to the fact that e to the x is an awesome function in calculus. This trick is working because the derivative of e to the x is equal to itself. I can't under-emphasize how extremely important it is that we have a function which is equal to its own derivative. Playing around with the product rule and the chain rule, we can use this fact to get this technique to work. So let's look at an example here. Suppose we take the equation dy over dx plus 2xy equals x. Take that as a differential equation. Notice this is already in the standard form. This is a first-order linear differential equation where here p of x is equal to 2x and q of x is equal to x. p of x is the one we have to know. q of x is really just on for the right. So identifying p of x here, we take an anti-derivative. Anti-derivative p of x, of course, would equal x squared over 2 plus a constant. But it doesn't matter which constant you use. So typically, just set that equal to 0 just to make life easier for you. So we're going to put that in as the, oh, I'm sorry. We don't have it 2 over x because it's just p was 2x. So we actually have a 2x squared over 2x. So we just get x squared. You're going to plug that in as the exponent of e. So our integrating factor is e to the x squared. So taking the original differential equation, we're going to multiply the left side by e to the x squared and the right-hand side to e to the x squared. Then the left-hand side, notice this could be rewritten as e to the x squared times y prime plus 2x e to the x squared times y. And this pony right here is none other than the derivative of e to the x squared. So this tells us that this expression could be written as the derivative of e to the x squared times y. Because this is just a consequence of the product rule. And so we get to this equation right here. The left-hand side will be the derivative of e to the x squared times y. The right-hand side is just q times i. We get x times e to the x squared. So now we have to integrate these things. The left-hand side will be pretty simple. When you integrate it, you're always just going to get i times y. The right-hand side will take some effort, right? How does one integrate that? As you're integrating x e to the x squared, in this situation, you're going to want to do a u substitution. Take u to equal x squared. So du equals 2x dx. We need a two right here and a one-half. That way you get your form. This thing will look like one-half of the integral of e to the u du. So it's anti-derivative will be just one-half e to the u plus a constant, or what you see right here. And so now where we're at is e to the x squared y is equal to one-half e to the x squared plus a constant. So just divide both sides by e to the x squared. e to the x squared. There's some simplification, of course, that happens here and here. And so then you're left with the final result, y, y equals one-half plus c times e to the negative x squared. I took a negative exponent here instead of dividing. The c does not absorb the e to the negative x squared because the constant, the arbitrary constant can only absorb constants, can't absorb a function. So you're going to get that y equals one-half plus c to the e to the negative x squared. And the c also cannot absorb this one-half. This is the general solution for this example right here. Let's look at another example here. This one without all the details spoiled out for us from the beginning. So we take the differential equation two, two y prime minus six y minus e to the x is equal to zero. They also give us some initial values. So we're going to solve the initial value problem associated to this differential equation. I noticed that this is a linear first-order differential equation because I have, this is a first-order because y prime is the biggest power present. And the only thing involved is just we have coefficients in front of my y's and y primes. So we're going to set this in the standard form, add e to the x to both sides of the equation. This gives us two y prime minus six y equals e to the x. And then divide everything by two. We want this to have a coefficient of one in front of the y prime. So then you're going to get y prime minus three y is equal to one-half e to the x. So far, so good. This is the standard form. Now we want to compute our integrating factor. So recognizing our function p of x here is actually negative three. Don't forget the coefficient right there. That's important. So then an anti-derivative of p of x, we can take negative three x. Typically there's a plus c, but we don't need that any constant would work in this situation. So we're going to take just that to be zero. And so my integrating factor i of x is going to look like e to negative three x. We multiply both sides of the equation by that factor right there. So we're going to get e to negative three x y minus three e to negative three x. Sorry, we have a y prime earlier. e to the negative three x y prime minus three e to the negative three x y. This is equal to one-half e to the x times e to the negative three x, like so. Now on the left-hand side, this will all factor as a derivative. The derivative, I'm just going to write it this way. We get e to the negative three x y and the whole thing is prime by the product rule. On the right-hand side, when you times exponentials together, you add together the exponents. So we get one-half e to the negative two x as your exponent right there. And so now we want to integrate these things. Integrate and integrate these things. So the left-hand side, since it's already a derivative, it's anti-derivative will just be negative e to the negative three x y. The right-hand side takes a little bit more effort, right? But in doing so, we're going to get one-half like we did before. We're going to get a negative one-half e to the negative two x plus a constant and then divide both sides by e to the negative three x. Make sure you hit everything with that e to the negative three x like so, comparing coefficients, I should say comparing powers of e. On the right-hand side, those things are going to cancel out. So we end up with y is equal to, we're going to get a negative one-fourth as a coefficient. We have e to the negative two x on top, e to the negative three x on bottom. When we combine those together, we'll just get an e to the x again. And then you're going to get plus c e to the three x because a negative x one on bottom is the same thing as a positive exponent on top. So this right here is our general solution, general solution. And if we were just interested in the general solution, we would be done right now. But remember, we're trying to solve an initial value problem. We have some initial conditions we have to check for. We have that y of zero is equal to five. So let's use that to help us find the coefficient. Just plug them in. We're going to get that y is five when x is zero. So we get e to the zero plus c times e to the zero. e to the zero is just a one. So we get five is equal to negative one-fourth plus c. Add one-fourth to both sides. So c is equal to five plus a fourth, which is 21 fourths. And so we'll plug that in right here. So our solution would be y equals negative one-fourth e to the x plus 21 over four e to the three x, like so. We can factor out the one-fourth that we want to, but this is perfectly fine right here. This is the solution to our differential equation. Solving linear differential equations is pretty nice. You just have to use this integrating factor. It's very algorithmic. There's a process. Those six steps we saw earlier, you do them every time in that order without any deviation and that'll always solve your linear differential equations. Some steps we can skip because it's already done for us, but it's a nice strategy. We really like it. It's like, oh, there's no, I don't even really have to think. I just have to compute, just compute, compute, compute, plug and chug and it'll get you to the solution of this linear differential equation every single time.