Mathematics
Level 1/ODEs

2. 1st Order

-----

A differential equation is a first order ODE if it contains a first derivative

dydx+f(x)y=g(x)\dfrac{dy}{dx} + f(x)y = g(x)

How to solve

Let the integrating factor (IF) be μ(x)\mu(x) such that multiplying both sides by μ(x)\mu(x) gives

μ(x)dydx+μ(x)f(x)y=g(x)μ(x)\mu(x)\dfrac{dy}{dx} + \mu(x)f(x)y = g(x)\mu(x)

we want μ(x)\mu(x) to an equation such that

d(μ(x)y)dx=μ(x)dydx+μ(x)f(x)y\dfrac{d(\mu(x)y)}{dx} = \mu(x)\dfrac{dy}{dx} + \mu(x)f(x)y

therefore by product rule we can say that

μ(x)=μ(x)f(x),f(x)=μ(x)μ(x)\mu'(x) = \mu(x)f(x), \quad f(x) = \dfrac{\mu'(x)}{\mu(x)}

solving for μ(x)\mu(x)

ln(μ(x))=f(x)  dxln(\mu(x)) = \int f(x) \; dx

so

μ(x)=ef(x)  dx\mu(x) = e^{\textstyle \int f(x)\, \; dx}

Note: f(x)f(x) isn't always integratable

Example

Solve

dydx+2xyx21=5x21\dfrac{dy}{dx} + \dfrac{2xy}{x^2 - 1} = 5x^2 - 1

Answer

f(x)=2xx21f(x) = \dfrac{2x}{x^2 -1}, g(x)=5x21\quad g(x) = 5x^2 - 1

μ(x)=e2xx21  dx=eln(x21)=x21\mu(x) = e^{\textstyle \int \frac{2x}{x^2 - 1}\, \; dx} \quad = \quad e^{ln(x^2 - 1)} \quad = \quad x^2 - 1

multiply both sides of the ODE by μ(x)\mu(x)

(x21)dydx+2xy=(x21)(5x21)(x^2 - 1)\dfrac{dy}{dx} + 2xy = (x^2 - 1)(5x^2 - 1)

the left side of the equation can now be integrated easily

(x21)y=5x46x2+1dx(x^2 - 1)y = \int{5x^4 - 6x^2 + 1\, dx}

therefore

y=x52x3+x+cx21y = \dfrac{x^5 - 2x^3 + x + c}{x^2 - 1}