 In this video, we're gonna discuss the solution to question 11 from the practice final exam for math 12-20, in which case we're asked to consider the first order linear differential equation two xy plus x cubed is equal to x dy over dx. And now this question actually comes with two parts. The first part is just to compute the integrating factor associated to this linear equation. And then we're gonna use that integrating factor to solve the differential equation. Now to recognize the integrating factor, it probably is helpful to put this differential equation in standard form. For a linear differential equation, it should look something like y prime plus p of x times y is equal to q of x. So we need the y and the y prime to be on the same side. So we're gonna move the two xy to the other side. This gives us that xy prime minus two xy equals x cubed. Then we need the coefficient of y prime just to be a one, so divide everything by x. Make sure you do it evenly there. In which case then we'll get y prime minus just two y is equal to x squared. And so when we standardize this linear equation, we get this equation y prime minus two y equals x squared. And therefore the function px is just given as negative two. Don't forget the sign, the sign's part of it as well. And the fact that it's a constant is not a big deal. To calculate the integrating factor, we have to, after identifying this function p of x, we have to integrate this thing. So integrate with respect to x right here. This will give us negative two x plus c. Now admittedly, if you forget the plus c, it's not such a big deal because for the integrating factor, it doesn't matter what the constant is. So for simplicity, we usually set it equal to zero. And so this will be one of the few times ever that I would allow you to omit the plus c without any penalty whatsoever. For the integrating factor i of x, we're gonna take e to the integral of p of x. And this can be any anti-derivative, doesn't matter which one it is. And so we end up with e to the negative two x. And it is helpful to put a box around your answer or something, so it's very clear to the greater, which what is your integrating factor? So we identified e to the negative two x. So now when we go to the next part of the question, we're gonna take the equation we had from before, y prime minus two y, this is equal to x squared. We're gonna times the left-hand side by e to the negative two x, the integrating factor. We're gonna times the right-hand side by that as well. So we're actually solving the differential equation using the integrating factor. Now on the right-hand side, you distribute it through, you distribute it through e to the negative two x, y prime minus two e to the negative two x, y. On the right-hand side, there's really no simplification to do their x squared times e to the negative two x. And we have to integrate this, these bad boys, on the right-hand side, we integrate, we integrate the left-hand side as well, that is an x right there, which of course do notice here on the right-hand side because of the integrating factor, the right-hand side is actually gonna simplify to be a derivative, right? So the left-hand side, it simplifies to be e to the negative two x, y prime is equal to x squared e to the negative two x, like so, right? And so this is the situation which we wanna integrate for which the right-hand, the left-hand side, because we're integrating the derivative, we're trying to find the anti-derivative of the derivative, that is to say, we're gonna end up with e to the negative two x, y. The left-hand side will simplify very nicely, it always will simplify to be the integrating factor times y. The right-hand side takes a little bit more effort, right? And that's often the case here, we have to integrate x squared e to the negative two x dx. On this one, I feel like integration by parts is probably the direction we want to go here because we have this power function times the x potential. We'll set u equal to x squared, so that when we take the derivative, the power will get smaller, so we get two x dx. And then we're gonna set the exponential as the dv, e to the negative two x dx, because whether you take the derivative or anti-derivative of the exponential, it's gonna be basically the same thing. We end up with negative one-half e to the negative two x, like so. And so when you put those things together on the right-hand side, you're gonna get negative x squared e to the negative two x over two, and then we're gonna get a positive, the integral of x e to the negative two x dx. In that case, the one-half and the two cancel out, and the usual negative sign that shows up with the integration by parts formula, also it becomes a plus here because it's a double negative in that situation. So now we have to evaluate the integral of x e to the negative two x. This will be very similar to what we just did a moment ago, and your integration by parts will be very similar. It should be u equals the, u equals the monomial because every time you take the derivative, it decreases by one, du become dx. And then anti-differentiate the exponential again, don't swap the roles. dv equals e to the negative two x dx. So v equals, again, negative one-half e to the negative two x. So putting all of those things in there, we get that e to the negative two x y equals x squared e to the negative two x over two. That should be a negative x squared there. And then doing this next one, we're gonna get another u and v. So we get a minus x e to the negative two x over two again. And now finally, we're gonna get a plus. Again, there's a double negative there. Integral of one-half e to the negative two x dx. And so this last one, we have to do the integral one more time. We've done the anti-derivative of e to the negative two x enough time to usually probably be pretty comfortable with it. e to the negative two x y equals negative x squared e to the negative two x over two. Just copying things down from the above. Negative x e to the negative two x over two. And then finally, we're gonna get a negative one fourth because you get another one-half that combines with the one-half that's already there. e to the negative two x. And now you do need your plus c plus a constant here. And so we're in the very convenient situation that we divide by e to the negative two x. You're gonna divide everything over here by e to the negative two x as well. And so this is just gonna be a lot of cancellation. And so in the end, we end up with y, y equals, whoops, y equals. We're gonna get a negative x squared over two because the e to the negative two x canceled out in that situation when we divided it through. Then we're gonna get a minus x over two. Same thing. The e to the negative two x cancels out. Then we're gonna get a minus one fourth. Same reason as before, right? The e to the negative two x cancels out. But in this situation, then we're gonna get c times e to the two x. Like so, because if you divide by e to the negative two x, that negative exponent of the denominator is redundant, so it comes up and becomes a positive. And therefore, we now have the solution to our differential equation, which you now see highlighted right here. Y equals negative one half x squared minus one half x minus one fourth plus c, sum arbitrary constant times e to the two x. We do not have an initial value, so we can't determine what that constant is. We'll just leave it as an arbitrary constant for this one. And this shows us how to solve this differential equation using integrating factors. Now, be aware that since this is a two-part question, if your first part was correct, but then the second part, you made some mistakes, you're still, of course, gonna get credit for the first one, and then you might get some partial credit on part b based upon what the error was. Now, on the other hand, if you calculated the incorrect integrating factor on part a, but then use that incorrect integrating factor correctly for part b, solving the differential equation, if your solution is correct based upon the incorrect integrating factor, you can still get full points for part b even though you lost some points on part a. And that's one of the reasons why this is broken up into two parts, to try to protect your score based upon some potential errors that one can make. But of course, if you have a correct integrating factor and you solved it correctly, you would get the full points right there. This version of the question is certainly on the harder side because you had to do integration reports twice, but be prepared with these integration techniques to solve a linear differential equation for this final exam.