 One method of solving differential equations is known as the method of integrating factors. It starts off this way. Suppose y f of x is equal to g of x. Differentiating gives us, which you'll notice a first order linear differential equation. Now consider the differential equation y prime f of x plus y f prime of x equals h of x. We can rewrite the left-hand side because it's just the derivative of y times f of x. And that means that we can recover y times f of x by the antiderivative of h of x. For example, let's solve x squared y prime plus 2xy equals e to the power x. So we'd like the left-hand side to be the derivative of a product. Well, wishful thinking may be nice to do, but it doesn't get us anywhere. Let's see what we actually need in order for the left-hand side to be a product. If the left-hand side is going to be a product, this requires x squared y prime plus 2xy has to be the derivative of f of x times y. Well, I know how to find the derivative of a product. Now if we compare the two sides, we see that x squared, the coefficient of y prime on the left, must be f of x, the coefficient of y prime on the right. Similarly, 2x, the coefficient of y on the left, must be f prime of x, the coefficient of y on the right. And so if I want the left-hand side of my differential equation to be the derivative of a product, we require that x squared be f of x and 2x be f prime of x. And here's the importance step. We see that if f of x is x squared, then f prime of x is in fact 2x. So our requirements are met. And so the left-hand side is the derivative of a product, namely, x squared times y. So equals means replaceable. So my left-hand side here is the derivative of x squared y. So that means x squared y is the anti-derivative of e to the x. Well, that is the world's simplest anti-derivative. So that will be, and don't forget, our constant of anti-differentiation. And now we have to solve for y. Fortunately, that isn't that difficult. And we have our solution. What about dy over dx plus y tangent x equals secant x? Again, if the left-hand side is the derivative of a product, we require dy over dx plus y tangent x equals the derivative of y times f of x, expanding the right-hand side using the product rule. And comparing our two sides, we see that f of x on the right-hand side is the coefficient of dy over dx. And so that means f of x must be 1, the coefficient of dy dx, on the left-hand side. Similarly, f prime of x must be tangent of x. And if f of x equals 1, then f prime of x equals tangent of x, and so we meet our requirement. Wait a minute. We don't. Now what? In a perfect world, we'd always get differential equations where one side was the derivative of a product, but we're not so lucky as to live in that world. However, maybe we can make our own luck. So let's think about this. Suppose I have a first-order linear differential equation. For any function i of x, we can multiply every term by i of x to get another first-order linear differential equation. And what we'd like is for the left-hand side to be the derivative of a product. But rather than rely on wishful thinking, let's see what we can do to make it the derivative of a product. So if our left-hand side is the derivative of h of xy, then expanding the right-hand side using the product rule tells us that we want i of x, the coefficient of y prime on the left, to be h of x, the coefficient of y prime on the right. And so h of x is going to be i of x. And similarly, we want i of x, f of x, the coefficient of y on the left, to be h prime of x, the coefficient of y on the right. And so h prime of x should be i of x, f of x. Now notice that h of x and h prime of x both include this factor of i of x. And so if we divide the one by the other, that factor drops out. So dividing h prime of x over h of x, we get. And if you stare at the left-hand side for a second, you'll recognize it has a very useful form. This is 1 over a function times its derivative. So if I find the anti-derivative of both sides, the left-hand side is just the log of h of x. And the right-hand side is the anti-derivative of f of x. And we can solve for h of x. And remember, h of x is equal to i of x. And so now we know i of x that will make the left-hand side the derivative of a product. Because this allows us to find a product by anti-differentiation, we say that i of x is an anti-differentiation factor. Well, actually, no one says that. Everybody calls us an integrating factor. But it's really an anti-differentiation factor. So let's consider this differential equation again. We determine that the left-hand side is not yet the derivative of a product. So we want to find i of x so that the left-hand side is the derivative of a product. And so this requires, if we expand the right-hand side using the product rule we get, and comparing the two sides, we see that we have this further requirement. i of x, the coefficient of dy dx on the left, must be h of x, the coefficient of y prime on the right. Similarly, i of x tangent of x, the coefficient of y on the left, must be h prime of x, the coefficient of y on the right. And again, if we look at h prime of x over h of x, we get, and what makes this work, is I can collapse this expression, h prime of x over h of x, by anti-differentiating to get. And we can then solve for h of x. So that tells us our integrating factor is secant x. So we'll multiply every term by secant x. And it's helpful to remember that all of this was said that our left-hand side was the derivative of h of x times y. Which means that if we've done everything correctly, all of this is the derivative of h of x, that's secant x, times y. Meanwhile, the right-hand side is just secant squared of x. So now I can anti-differentiate both sides. And finally, solve for y.