μ(x)=e∫f(x)dx
You use the integrating factor when the differential equation is not exact.
1. First Order Linear Ordinary Differential Equations
If the differential equation is in the form dxdy+f(x)⋅y=g(x), you could use the integrating factor, μ(x). Keep this form in mind.
Remember the product rule? It’s dxd(f⋅g)=f′⋅g+f⋅g′.
Let’s replace f with the y and g with a function that we don’t know μ(x), so that it satisfies dxd(μ(x)⋅y)=μ′(x)⋅y+dxdy⋅μ(x), so that you can get a form that’s similar with dxdy+f(x)⋅y=g(x).
If you multiply everything by the integrating factor, you get μ(x)dxdy+μ(x)⋅f(x)⋅y=μ(x)⋅g(x).
From above:
dxd(μ(x)⋅y)=μ′(x)⋅y+dxdy⋅μ(x)
μ(x)dxdy+μ(x)⋅f(x)⋅y=μ(x)⋅g(x)
Comparing where the y‘s are: μ(x)⋅f(x)=μ′(x)
μ(x)μ′(x)=f(x)
∫μ(x)μ′(x)dx=∫f(x)dx
ln∣μ(x)∣=∫f(x)dx
μ(x)=e∫f(x)dx. Do not worry about plus-minus - you only need one integrating factor.
So, substitute this μ(x) into μ(x)dxdy+μ(x)⋅f(x)⋅y=μ(x)⋅g(x) and you notice: the left hand side is dxd(μ(x)⋅y)
dxd(μ(x)⋅y)=μ(x)⋅g(x)
You can then solve the equation from there.
For reference: y⋅ef(x)=∫g(x)⋅μ(x)dx+c
1.1. Example
dxdy+52y=3e−x , y(0)=5
Recall that your integrating factor μ(x) is e∫f(x)dx, so in this case, μ(x)=e∫52dx.
e52xdxdy+52e52xy=3e−53x
dxd(e52xy)=3e−53x
e52xy=−5e−53x+c
y=e−x(ce53x−5)
Let’s plug in the initial conditions to find the constant c: 5=e−0(ce53⋅0−5)
c=10
y=5e−x(2e53x−1)
2. First Order Non-Exact Differential Equations
Use μ(x)=e∫g∂y∂f−∂x∂gdx for when you have the form fdx+gdy=0, and the equation is not exact.
Like before, find μ(x) and multiply everything by μ(x).
2.1. Example
(4siny+x6)dx+xcosydy=0
As you can see, the functions f and g are both functions of both x and y, so we must use partial differentials. Don’t be scared - this just means you need to take the partial derivative of the function.
Using the formula, f=4siny+x6 and g=xcosy.
Take the partial derivative of f with respect to y, and the partial derivative of g with respect to x. When you are taking the partial derivative of one variable, all the other variables are considered constants. ∂y∂f=4cosy and ∂x∂g=cosy.
Therefore, μ(x)=e∫xcosy4cosy−cosydx=x3.
Multiply every term by μ(x): (4x3siny+6x2)dx+x4cosydy=0.
Now this is just an exact equation you can solve. Let F be the general solution to the equation and that F=∂x∂Fdx+∂y∂Fdy=0.
f=∂x∂F=4x3siny+6x2, g=∂y∂F=x4cosy
Using ∂x∂F=4x3siny+6x2, integrate: F=x4siny+2x3+f(y).
Then differentiate: ∂y∂F=x4cosy+f′(y).
Compare: Therefore f′(y)=0, so f(y)=c.
Substitute into F: F=x4siny+2x3+c, and recall that F=0, so x4siny+2x3=c.