 In this video, we provide the solution to question number nine for practice exam number three for math 1220. And we're given a first order linear differential equation 2xy plus x cubed is equal to x times the derivative of y with respect to x. Now, since this is a first order linear differential equation, the best method to solve this is using an integrating factor. So part A of this question actually wants you to compute the integrating factor and then use that integrating factor to solve part B, to solve the differential equation there. So in order to find the integrating factor, I'm going to first put this in standard form. So in particular, I'm going to move the 2xy to the other side of the equation. This rewrites the equation as xy prime. I'll just use y prime to be short for dy over dx minus 2xy is equal to x cubed. I want the coefficient of y prime just to be one. So I'm going to divide both sides by x. So we get y prime minus 2y is equal to x squared in that situation. So this then gives us the standard form for a first order linear differential equation. This then tells us that the integrating factor is then going to equal the exponential e to the power of where we take the coefficient of the y right here. Do make sure you grab the negative sign. So you're going to get the integral of negative 2 dx there for which you can grab any anti-derivative on this one. It doesn't matter. So I'm going to grab from that one negative 2x. And so my integrating factor is e to the negative 2x there. So that's part A. Part B, we then want to solve the differential equation by taking this right here and multiplying on both sides by the integrating factor. This is going to give us e to the negative 2x y prime minus 2 e to the negative 2x y is equal to x squared times e to the negative x like so. Then on the left hand side, it's going to factor very nice. If you skip a lot of the steps there, I'm okay with that. The left hand side, because it looks like the product derivative, when you take the integral both sides, you're going to take the integral with respect to e to the negative 2x. Y, I know the anti-derivative there. The left hand, on the right hand side is the interesting one, x squared e to the negative x dx like so. So on that one, on the, because like we said, on the left hand side, it's just going to be e to the negative 2x y. That's no problem there. On the right hand side, I'm a little bit more interested. Integration by part seems like the appropriate tool right here where we can take u to be x squared. So du is equal to 2x. We take dv to equal e to the negative x, v equal to negative e to the negative x like so. And so if we plug that in for integration by parts, we're going to get negative e to the negative. Oh, I wrote negative x there. That should be a 2. That should be a 2. And so this should be a 2, which then gives us a 1 half there. That was an important thing to notice at this moment. So we're going to get a e to the negative, excuse me, let me fix part of this, put my 2's back on the screen. We got a 2 there. We had a 2 there. So this should be a 2 here. This should be a 2 here and should divide by 2. All right, so let's try this again. We're going to get negative 1 half x squared e to the negative 2x like so. Then for the integral, you're going to get negative the integral of v du, which the 1 half here cancels the 2 right there. The negative here will cancel with the forthcoming negative. So you're going to get the integral of just x e to the negative 2x dx for which when you look at that second integral, we're going to do integration by parts again for which same basic strategy u equals x, which means du equals dx. Then dv is going to again be e to the negative 2x dx. I'll do it right this time though. So v then turns out to be negative 1 half e to the negative 2x. When you put those all together, we're going to end up with e to the negative 2x y is equal to negative 1 half x squared e to the negative 2x. Then we end up with a uv here minus 1 half x e to the negative 2x. And then our integral, we're going to get a positive again because it's a double negative, but the 1 half won't cancel out this time. We get 1 half e to the negative 2x dx. So we got to do one more integral there, just copying down the things from above. Now this time I have to do the anti-drift e to the negative 2x again, which I've done that already a couple times. You're going to get negative this time 1 fourth, the 1 half that's already there will combine with the new 1 half that comes from the anti-derivative e to the negative 2x plus a constant. Don't forget that plus a constant, that's very important with this differential equation. Now to solve for y, we're going to divide both sides by e to the negative 2x. That's going to cancel out this one and this one and this one. So we end up with a negative x squared over 2. We're going to get a negative x over 2. We're going to get a negative 1 fourth and then lastly we're going to get c times e to the positive 2x like so. And this then gives us the solution to this linear differential equation.