The math optional, made finite. Daily Practice

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 μ=ePdx\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μ ⁣[μQdx+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: μ=ePdx\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=μQdx+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 xcosxdydx+y(xsinx+cosx)=1x\cos x\,\dfrac{dy}{dx}+y(x\sin x+\cos x)=1.

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

Step 2 — Integrating factor. Pdx=tanxdx+dxx=lncosx+lnx=ln ⁣(xcosx),\int P\,dx = \int\tan x\,dx + \int\frac{dx}{x} = -\ln|\cos x| + \ln|x| = \ln\!\left(\frac{x}{\cos x}\right), μ=xsecx.\mu = x\sec x.

Step 3 — Multiply and integrate. The RHS simplifies: ddx(xsecxy)=xsecxsecxx=sec2x.\frac{d}{dx}(x\sec x\cdot y) = x\sec x\cdot\frac{\sec x}{x} = \sec^2 x. Integrate: xsecxy=tanx+C.x\sec x\cdot y = \tan x + C.

Step 4 — Solve for yy. y=sinx+Ccosxx.\boxed{y = \frac{\sin x + C\cos x}{x}.}

Worked Example 2

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

Solve dydx=11+x2(earctanxy)\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+x2y=earctanx1+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=earctanx/(1+x2)Q = e^{\arctan x}/(1+x^2).

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

Step 3 — Multiply and integrate. Substitute t=arctanxt = \arctan x: ddx(earctanxy)=e2arctanx1+x2,\frac{d}{dx}(e^{\arctan x}\,y) = \frac{e^{2\arctan x}}{1+x^2}, earctanxy=e2tdt=12e2arctanx+C.e^{\arctan x}\,y = \int e^{2t}\,dt = \frac{1}{2}e^{2\arctan x}+C.

Step 4 — Solve for yy. y=12earctanx+Cearctanx.\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(1xtanx)+x2cosx}dxxdy=0\{y(1-x\tan x)+x^2\cos x\}\,dx - x\,dy = 0.

Step 1 — Standard form. Rearrange to express dy/dxdy/dx: dydx1xtanxxy=xcosx.\frac{dy}{dx} - \frac{1-x\tan x}{x}\,y = x\cos x. So P=(1/x)+tanxP = -(1/x) + \tan x and Q=xcosxQ = x\cos x.

Step 2 — Integrating factor. Pdx=lnxlncosx=ln(xcosx),\int P\,dx = -\ln x - \ln|\cos x| = -\ln(x\cos x), μ=1xcosx.\mu = \frac{1}{x\cos x}.

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

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

Worked Example 4

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

Solve dydx2xy=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=ex2.\mu = e^{\int(-2x)\,dx} = e^{-x^2}.

Step 3 — Multiply and integrate. ddx(ex2y)=2ex2.\frac{d}{dx}(e^{-x^2}y) = 2e^{-x^2}. Recall erf(x)=2π0xet2dt\operatorname{erf}(x) = \dfrac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt, so 2ex2dx=πerf(x)+const\int 2e^{-x^2}\,dx = \sqrt\pi\,\operatorname{erf}(x) + \text{const}: ex2y=π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=μQdx+C0\mu y = \int \mu Q\,dx + C_0.
  2. Write Q=P(Q/P)Q = P\cdot(Q/P) inside the integral; recognise ePdxPdx=d(ePdx)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=QPePdx ⁣{C+ePdxd ⁣(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=μQdx+C0,μ=ePdx.\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: μQdx=QPd(μ).\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): QPd(μ)=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=QPePdx ⁣{C+ePdxd ⁣(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

We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.