Skip to main content
Examonaut

Topic 9 · Lesson 1 of 4

First order equations and integrating factors

The integrating factor

An equation of the form

dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x)

is first order linear. Usually it cannot be separated. The trick is to multiply through by the integrating factor I(x)=e∫P(x) dxI(x) = e^{\int P(x) \, dx}, which has the property I′(x)=P(x)I(x)I'(x) = P(x)I(x). Then the left side becomes an exact derivative, by the product rule:

Idydx+IPy=Idydx+I′y=ddx(Iy)I\frac{dy}{dx} + IPy = I\frac{dy}{dx} + I'y = \frac{d}{dx}(Iy)

so ddx(Iy)=IQ\frac{d}{dx}(Iy) = IQ, and integrating both sides gives Iy=∫IQ dxIy = \int IQ \, dx. You may quote the integrating factor without proof.

Method

  1. Step 1: Divide through so that the coefficient of dydx\frac{dy}{dx} is 1; identify P(x)P(x).
  2. Step 2: Find I=e∫P dxI = e^{\int P \, dx} (no constant needed), simplifying with eln⁡f(x)=f(x)e^{\ln f(x)} = f(x).
  3. Step 3: Write ddx(Iy)=IQ\frac{d}{dx}(Iy) = IQ.
  4. Step 4: Integrate, including the constant, then divide by II.

Worked example

An integrating factor

Find the general solution of xdydx+2y=x3x\frac{dy}{dx} + 2y = x^3, for x>0x > 0.

Show solution
  1. Divide by xx: dydx+2xy=x2\frac{dy}{dx} + \frac{2}{x}y = x^2, so P=2xP = \frac{2}{x}.
  2. I=e∫2/x dx=e2ln⁡x=x2I = e^{\int 2/x \, dx} = e^{2\ln x} = x^2.
  3. ddx(x2y)=x4\frac{d}{dx}(x^2y) = x^4.
  4. x2y=x55+cx^2y = \frac{x^5}{5} + c, so y=x35+cx2y = \frac{x^3}{5} + \frac{c}{x^2}.

Notice that the constant ends up divided by x2x^2: adding it after dividing is a common and costly error.

Worked example

A trigonometric coefficient

Solve dydx+ytan⁡x=cos⁡x\frac{dy}{dx} + y\tan x = \cos x, given y=2y = 2 when x=0x = 0.

Show solution
  1. I=e∫tan⁡x dx=eln⁡sec⁡x=sec⁡xI = e^{\int \tan x \, dx} = e^{\ln\sec x} = \sec x.
  2. ddx(ysec⁡x)=cos⁡xsec⁡x=1\frac{d}{dx}(y\sec x) = \cos x\sec x = 1, so ysec⁡x=x+cy\sec x = x + c and y=(x+c)cos⁡xy = (x + c)\cos x.
  3. x=0x = 0, y=2y = 2 gives c=2c = 2: y=(x+2)cos⁡xy = (x + 2)\cos x.

General and particular solutions

The general solution contains an arbitrary constant, so it describes a family of curves; a boundary condition picks out one particular solution. For a sketch of the family, choose a few values of the constant (including 0, positive and negative) and look at how each term behaves: in y=x35+cx2y = \frac{x^3}{5} + \frac{c}{x^2}, every curve behaves like x35\frac{x^3}{5} for large xx, while near x=0x = 0 the cx2\frac{c}{x^2} term takes over, sending the curve to +∞+\infty if c>0c > 0 and −∞-\infty if c<0c < 0.

Try it: tap the slope field to choose a point, and see the solution curve through it and the integrating factor working that gives its equation. The second-order mode shows simple harmonic motion, damping and resonance.

Try it: simulation

Differential equations

Loading the simulation…

Modelling with first order equations

Read rates carefully: "the rate of increase of xx" is dxdt\frac{dx}{dt}, and "in minus out" gives the equation in mixing problems.

A tank holds 100 litres of water. Brine containing 0.2 kg of salt per litre flows in at 3 litres per minute and the well-mixed liquid flows out at 2 litres per minute. After tt minutes the volume is 100+t100 + t litres, and if xx kg of salt is in the tank, the concentration is x100+t\frac{x}{100 + t}. So

dxdt=0.6−2x100+t\frac{dx}{dt} = 0.6 - \frac{2x}{100 + t}

The integrating factor is (100+t)2(100 + t)^2, giving x(100+t)2=0.2(100+t)3+cx(100 + t)^2 = 0.2(100 + t)^3 + c. Since x=0x = 0 when t=0t = 0, c=−200 000c = -200\,000, and x=0.2(100+t)−200 000(100+t)2x = 0.2(100 + t) - \frac{200\,000}{(100 + t)^2}.

Practise this topic

Both are part of Premium.