Linear first-order

At a Glance

Why This Chapter Matters

Linear first-order ODEs appear in Section B compulsory question Q5 in most years — always for 10 marks, always easy. The integrating-factor technique is a single five-step algorithm that works identically on every question: rearrange, read off PP and QQ, compute μ=e∫P dx\mu = e^{\int P\,dx}, multiply through, integrate. The only variety is how the RHS simplifies after multiplying by μ\mu — each question is designed to collapse to something integrable by inspection. Master one template, collect 10 free marks.

Minimum Theory

Standard form. A linear first-order ODE has the form dydx+P(x) y=Q(x).\frac{dy}{dx} + P(x)\,y = Q(x). If the equation is not in this form, divide by the coefficient of dy/dxdy/dx first.

Integrating factor. Compute μ(x)=exp⁡ ⁣∫P(x) dx.\mu(x) = \exp\!\int P(x)\,dx. Multiplying both sides by μ\mu converts the left side to an exact derivative: ddx(μy)=μQ.\frac{d}{dx}(\mu y) = \mu Q.

General solution. Integrate both sides and divide by μ\mu: y=1μ ⁣[∫μQ dx+C].y = \frac{1}{\mu}\!\left[\int \mu Q\,dx + C\right].

Integrating-factor method flow

Question Archetypes

ArchetypeRecognition
linear-first-orderA first-order ODE linear in yy; asked to “solve” or given an initial condition
linear-solution-form”Show the general solution can be written as [formula]” — a derivation via integration by parts

linear-first-order (4 question(s); 2015, 2016, 2016, 2023)

Solve a linear first-order ODE via an integrating factor

Recognition Cues

Solution Template

  1. Rearrange to standard form: divide by the coefficient of dy/dxdy/dx to get y′+P(x)y=Q(x)y' + P(x)y = Q(x).
  2. Compute the integrating factor: μ=e∫P dx\mu = e^{\int P\,dx} (no constant of integration needed).
  3. Multiply through: the LHS becomes ddx(μy)\dfrac{d}{dx}(\mu y).
  4. Integrate the RHS: μy=∫μQ dx+C\mu y = \int \mu Q\,dx + C.
  5. Divide by μ\mu to get yy explicitly; apply any initial condition to find CC.

Worked Example 1

2015 Paper 1, 2015-P1-Q5a (10 marks)

Solve xcos⁡x dydx+y(xsin⁡x+cos⁡x)=1x\cos x\,\dfrac{dy}{dx}+y(x\sin x+\cos x)=1.

Step 1 — Standard form. Divide by xcos⁡xx\cos x: dydx+(tan⁡x+1x)y=sec⁡xx.\frac{dy}{dx} + \Bigl(\tan x + \frac{1}{x}\Bigr)y = \frac{\sec x}{x}. So P=tan⁡x+1/xP = \tan x + 1/x and Q=sec⁡x/xQ = \sec x / x.

Step 2 — Integrating factor. ∫P dx=∫tan⁡x dx+∫dxx=−ln⁡∣cos⁡x∣+ln⁡∣x∣=ln⁡ ⁣(xcos⁡x),\int P\,dx = \int\tan x\,dx + \int\frac{dx}{x} = -\ln|\cos x| + \ln|x| = \ln\!\left(\frac{x}{\cos x}\right), μ=xsec⁡x.\mu = x\sec x.

Step 3 — Multiply and integrate. The RHS simplifies: ddx(xsec⁡x⋅y)=xsec⁡x⋅sec⁡xx=sec⁡2x.\frac{d}{dx}(x\sec x\cdot y) = x\sec x\cdot\frac{\sec x}{x} = \sec^2 x. Integrate: xsec⁡x⋅y=tan⁡x+C.x\sec x\cdot y = \tan x + C.

Step 4 — Solve for yy. y=sin⁡x+Ccos⁡xx.\boxed{y = \frac{\sin x + C\cos x}{x}.}

Worked Example 2

2016 Paper 1, 2016-P1-Q5c (10 marks)

Solve dydx=11+x2(earctan⁡x−y)\dfrac{dy}{dx} = \dfrac{1}{1+x^2}\bigl(e^{\arctan x}-y\bigr).

Step 1 — Standard form. Move y/(1+x2)y/(1+x^2) to the left: dydx+11+x2 y=earctan⁡x1+x2.\frac{dy}{dx} + \frac{1}{1+x^2}\,y = \frac{e^{\arctan x}}{1+x^2}. So P=1/(1+x2)P = 1/(1+x^2) and Q=earctan⁡x/(1+x2)Q = e^{\arctan x}/(1+x^2).

Step 2 — Integrating factor. μ=e∫dx/(1+x2)=earctan⁡x.\mu = e^{\int dx/(1+x^2)} = e^{\arctan x}.

Step 3 — Multiply and integrate. Substitute t=arctan⁡xt = \arctan x: ddx(earctan⁡x y)=e2arctan⁡x1+x2,\frac{d}{dx}(e^{\arctan x}\,y) = \frac{e^{2\arctan x}}{1+x^2}, earctan⁡x y=∫e2t dt=12e2arctan⁡x+C.e^{\arctan x}\,y = \int e^{2t}\,dt = \frac{1}{2}e^{2\arctan x}+C.

Step 4 — Solve for yy. y=12earctan⁡x+C e−arctan⁡x.\boxed{y = \frac{1}{2}e^{\arctan x} + C\,e^{-\arctan x}.}

Worked Example 3

2016 Paper 1, 2016-P1-Q6a (10 marks)

Solve {y(1−xtan⁡x)+x2cos⁡x} dx−x dy=0\{y(1-x\tan x)+x^2\cos x\}\,dx - x\,dy = 0.

Step 1 — Standard form. Rearrange to express dy/dxdy/dx: dydx−1−xtan⁡xx y=xcos⁡x.\frac{dy}{dx} - \frac{1-x\tan x}{x}\,y = x\cos x. So P=−(1/x)+tan⁡xP = -(1/x) + \tan x and Q=xcos⁡xQ = x\cos x.

Step 2 — Integrating factor. ∫P dx=−ln⁡x−ln⁡∣cos⁡x∣=−ln⁡(xcos⁡x),\int P\,dx = -\ln x - \ln|\cos x| = -\ln(x\cos x), μ=1xcos⁡x.\mu = \frac{1}{x\cos x}.

Step 3 — Multiply and integrate. The RHS collapses exactly: ddx ⁣(yxcos⁡x)=1xcos⁡x⋅xcos⁡x=1.\frac{d}{dx}\!\left(\frac{y}{x\cos x}\right) = \frac{1}{x\cos x}\cdot x\cos x = 1. Integrate: yxcos⁡x=x+C.\frac{y}{x\cos x} = x + C.

Step 4 — Solve for yy. y=xcos⁡x (x+C).\boxed{y = x\cos x\,(x+C).}

Worked Example 4

2023 Paper 1, 2023-P1-Q5a (10 marks)

Solve dydx−2xy=2\dfrac{dy}{dx}-2xy=2, y(0)=1y(0)=1, in the form y=ex2[1+π erf⁡(x)]y=e^{x^2}[1+\sqrt{\pi}\,\operatorname{erf}(x)].

Step 1 — Standard form. Already in standard form: P=−2xP = -2x, Q=2Q = 2.

Step 2 — Integrating factor. μ=e∫(−2x) dx=e−x2.\mu = e^{\int(-2x)\,dx} = e^{-x^2}.

Step 3 — Multiply and integrate. ddx(e−x2y)=2e−x2.\frac{d}{dx}(e^{-x^2}y) = 2e^{-x^2}. Recall erf⁡(x)=2π∫0xe−t2 dt\operatorname{erf}(x) = \dfrac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt, so ∫2e−x2 dx=π erf⁡(x)+const\int 2e^{-x^2}\,dx = \sqrt\pi\,\operatorname{erf}(x) + \text{const}: e−x2y=π erf⁡(x)+C.e^{-x^2}y = \sqrt\pi\,\operatorname{erf}(x) + C.

Step 4 — Apply initial condition. At x=0x=0: 1=0+C1 = 0 + C, so C=1C=1. y=ex2[1+π erf⁡(x)].\boxed{y = e^{x^2}[1+\sqrt\pi\,\operatorname{erf}(x)].}

Common Traps

linear-solution-form (1 question(s); 2022)

Derive/prove a closed form for the general solution of y′+Py=Qy'+Py=Q

Recognition Cues

Solution Template

  1. Write the standard IF solution: μy=∫μQ dx+C0\mu y = \int \mu Q\,dx + C_0.
  2. Write Q=P⋅(Q/P)Q = P\cdot(Q/P) inside the integral; recognise e∫P dx⋅P dx=d(e∫P dx)e^{\int P\,dx}\cdot P\,dx = d(e^{\int P\,dx}).
  3. Integrate by parts: ∫(Q/P) d(μ)=(Q/P)μ−∫μ d(Q/P)\int (Q/P)\,d(\mu) = (Q/P)\mu - \int\mu\,d(Q/P).
  4. Assemble, divide by μ\mu, and rename C=−C0C = -C_0 to match the target sign.

Worked Example

2022 Paper 1, 2022-P1-Q5a (10 marks)

Show that the general solution of y′+Py=Qy'+Py=Q can be written as y=QP−e−∫P dx ⁣{C+∫e∫P dx d ⁣(QP)}.y=\frac{Q}{P}-e^{-\int P\,dx}\!\left\{C+\int e^{\int P\,dx}\,d\!\left(\frac{Q}{P}\right)\right\}.

Step 1 — Standard solution. The integrating-factor method gives μy=∫μQ dx+C0,μ=e∫P dx.\mu y = \int\mu Q\,dx + C_0, \qquad \mu = e^{\int P\,dx}.

Step 2 — Rewrite the integral. Inside the integral write Q=P⋅(Q/P)Q = P\cdot(Q/P). Since d(μ)=Pμ dxd(\mu) = P\mu\,dx: ∫μQ dx=∫QP d(μ).\int \mu Q\,dx = \int \frac{Q}{P}\,d(\mu).

Step 3 — Integrate by parts. With u=Q/Pu = Q/P and dv=d(μ)dv = d(\mu): ∫QP d(μ)=QP⋅μ−∫μ d ⁣(QP).\int\frac{Q}{P}\,d(\mu) = \frac{Q}{P}\cdot\mu - \int\mu\,d\!\left(\frac{Q}{P}\right).

Step 4 — Assemble. Substituting back: μy=QP⋅μ−∫μ d ⁣(QP)+C0.\mu y = \frac{Q}{P}\cdot\mu - \int\mu\,d\!\left(\frac{Q}{P}\right) + C_0. Divide by μ\mu and set C=−C0C = -C_0: y=QP−e−∫P dx ⁣{C+∫e∫P dx d ⁣(QP)}.■\boxed{y = \frac{Q}{P} - e^{-\int P\,dx}\!\left\{C + \int e^{\int P\,dx}\,d\!\left(\frac{Q}{P}\right)\right\}.}\qquad\blacksquare

Common Traps

Marks-Aware Writing

For a 10-mark computation question: Write all five steps explicitly — standard form (with division shown), integrating factor (with the integral written out), the d(μy)/dxd(\mu y)/dx step, integration of the RHS, and the final yy. A correct final answer with two steps missing earns at most 5 marks. Label each step clearly.

For the 2022 proof question: Structure the derivation in numbered steps. The integration-by-parts step must display uu, dvdv, and the result explicitly — “integrate by parts and simplify” earns no marks. Conclude with ■\blacksquare and box the target expression.

Practice Set

Ready to drill what you just read?

Daily Practice turns these patterns into one adaptive set a day — practised daily until they're automatic, free for everyone.

See Daily Practice →

This chapter is part of the Maths Coverage Map — 14 years, mapped. Get the take-away PDF free.