The math optional, made finite. Daily Practice

Method of variation of parameters

At a Glance

Why This Chapter Matters

Variation of parameters appears in 11 of the last 13 years — only two years missed, making it the most consistently examined technique in Paper 1 Section B. The method works on any second-order linear ODE regardless of the right-hand side: it handles sec\sec, log\log, tan\tan, polynomials, and combinations that undetermined coefficients cannot touch. In every question the four-step skeleton is the same; the skill is recognising which variant you need (standard CF, Cauchy-Euler, or reduction-of-order) before the VoP machinery kicks in.

Minimum Theory

The formula. Given y+P(x)y+Q(x)y=g(x)y''+P(x)y'+Q(x)y=g(x) with two complementary functions y1,y2y_1,y_2, seek yp=u1y1+u2y2y_p=u_1y_1+u_2y_2 where u1=y2gW,u2=y1gW,W=y1y2y2y1.u_1'=-\frac{y_2\,g}{W},\qquad u_2'=\frac{y_1\,g}{W},\qquad W=y_1y_2'-y_2y_1'. This is the standard form — the ODE must have leading coefficient 11 before you read off g(x)g(x). For ay+=R(x)ay''+\ldots=R(x), divide everything by aa first; then g=R/ag=R/a.

Two constraints, two equations. The conditions u1y1+u2y2=0u_1'y_1+u_2'y_2=0 and u1y1+u2y2=gu_1'y_1'+u_2'y_2'=g uniquely determine u1u_1' and u2u_2' via Cramer’s rule — the formulas above.

Getting both CF solutions. The VoP formula needs two independent homogeneous solutions. Three sub-cases arise:

  1. Constant coefficients (most common): solve the auxiliary equation; the roots give exponential, trigonometric, or repeated-root CF.
  2. Cauchy-Euler (x2yx^2y''-\ldots): try y=xmy=x^m to get the indicial equation; roots m1,m2m_1,m_2 give y1=xm1y_1=x^{m_1}, y2=xm2y_2=x^{m_2}.
  3. One CF given: use reduction of order (y2=v(x)y1y_2=v(x)y_1) or operator factorisation to find the second.

Question Archetypes

Three patterns cover all VoP questions.

ArchetypeYou are seeing this when…
variation-of-parametersa standard constant-coefficient ODE with an “awkward” RHS
vop-cauchy-eulerthe equation has x2y,xyx^2y'',\,xy' terms (Euler–Cauchy type)
vop-after-reductionone CF solution is given and you must find the second

variation-of-parameters (5 question(s); 2013, 2014, 2016, 2017, 2018)

Recognition Cues

Solution Template

  1. Write the auxiliary equation and find the two CF solutions y1,y2y_1,y_2.
  2. Compute W=y1y2y2y1W=y_1y_2'-y_2y_1'.
  3. Write u1=y2g/Wu_1'=-y_2g/W and u2=y1g/Wu_2'=y_1g/W where gg is the RHS of the standard-form ODE.
  4. Integrate to find u1,u2u_1,u_2. Use standard integrals: tan(ax)dx=1alncos(ax)\int\tan(ax)\,dx=-\tfrac1a\ln|\cos(ax)|; sec(2x)dx=12lnsec2x+tan2x\int\sec(2x)\,dx=\tfrac12\ln|\sec2x+\tan2x|; eaxsin(bx)dx=eax(asinbxbcosbx)a2+b2\int e^{ax}\sin(bx)\,dx=\tfrac{e^{ax}(a\sin bx-b\cos bx)}{a^2+b^2}; xlogxdx=x22logxx24\int x\log x\,dx=\tfrac{x^2}{2}\log x-\tfrac{x^2}{4}.
  5. Write yp=u1y1+u2y2y_p=u_1y_1+u_2y_2 and simplify using trig identities if needed.
  6. General solution: y=yc+ypy=y_c+y_p.

Worked Example(s)

2013 Paper 1, 2013-P1-Q6b (10 marks)

Solve y+a2y=secaxy''+a^2y=\sec ax by variation of parameters.

CF. Auxiliary equation r2+a2=0y1=cosax,y2=sinaxr^2+a^2=0\Rightarrow y_1=\cos ax,\,y_2=\sin ax.

Wronskian. W=acos2ax+asin2ax=aW=a\cos^2ax+a\sin^2ax=a.

Integrands (g=secaxg=\sec ax): u1=sinaxsecaxa=tanaxa    u1=lncosaxa2.u_1'=-\frac{\sin ax\cdot\sec ax}{a}=-\frac{\tan ax}{a}\;\Rightarrow\;u_1=\frac{\ln|\cos ax|}{a^2}. u2=cosaxsecaxa=1a    u2=xa.u_2'=\frac{\cos ax\cdot\sec ax}{a}=\frac{1}{a}\;\Rightarrow\;u_2=\frac{x}{a}.

Particular integral: yp=cosaxa2lncosax+xsinaxa.y_p=\frac{\cos ax}{a^2}\ln|\cos ax|+\frac{x\sin ax}{a}.

  y=C1cosax+C2sinax+cosaxa2lncosax+xsinaxa.  \boxed{\;y=C_1\cos ax+C_2\sin ax+\frac{\cos ax}{a^2}\ln|\cos ax|+\frac{x\sin ax}{a}.\;}


2016 Paper 1, 2016-P1-Q6b (15 marks)

Solve (D2+2D+1)y=exlogx(D^2+2D+1)y=e^{-x}\log x by variation of parameters.

CF. (D+1)2=0(D+1)^2=0 — repeated root D=1D=-1: y1=exy_1=e^{-x}, y2=xexy_2=xe^{-x}.

Wronskian. W=e2xW=e^{-2x}.

Integrands (g=exlogxg=e^{-x}\log x): the exponentials cancel: y2g/W=xlogxy_2g/W=x\log x and y1g/W=logxy_1g/W=\log x.

xlogxdx=x22logxx24,logxdx=xlogxx.\int x\log x\,dx=\tfrac{x^2}{2}\log x-\tfrac{x^2}{4},\qquad\int\log x\,dx=x\log x-x.

Assemble: yp=ex ⁣(x22logxx24)+xex(xlogxx)=ex ⁣(x22logx3x24).y_p=-e^{-x}\!\left(\tfrac{x^2}{2}\log x-\tfrac{x^2}{4}\right)+xe^{-x}(x\log x-x)=e^{-x}\!\left(\tfrac{x^2}{2}\log x-\tfrac{3x^2}{4}\right).

  y=(c1+c2x)ex+ex ⁣(x22logx3x24).  \boxed{\;y=(c_1+c_2x)e^{-x}+e^{-x}\!\left(\frac{x^2}{2}\log x-\frac{3x^2}{4}\right).\;}


2018 Paper 1, 2018-P1-Q6c (13 marks)

Solve y+16y=32sec2xy''+16y=32\sec2x.

CF. r2+16=0y1=cos4x,y2=sin4xr^2+16=0\Rightarrow y_1=\cos4x,\,y_2=\sin4x; W=4W=4.

Compute u1,u2u_1,u_2 (g=32sec2xg=32\sec2x): u1=sin4x32sec2x4=8sin4xcos2x.u_1'=-\frac{\sin4x\cdot32\sec2x}{4}=-8\cdot\frac{\sin4x}{\cos2x}. Use sin4x=2sin2xcos2x\sin4x=2\sin2x\cos2x: u1=16sin2xu1=8cos2xu_1'=-16\sin2x\Rightarrow u_1=8\cos2x.

u2=cos4x32sec2x4=8cos4xcos2x.u_2'=\frac{\cos4x\cdot32\sec2x}{4}=8\cdot\frac{\cos4x}{\cos2x}. Use cos4x=2cos22x1\cos4x=2\cos^22x-1: u2=16cos2x8sec2xu2=8sin2x4lnsec2x+tan2xu_2'=16\cos2x-8\sec2x\Rightarrow u_2=8\sin2x-4\ln|\sec2x+\tan2x|.

Combine: u1y1+u2y2u_1y_1+u_2y_2 has elementary part 8(cos2xcos4x+sin2xsin4x)=8cos2x8(\cos2x\cos4x+\sin2x\sin4x)=8\cos2x: yp=8cos2x4sin4xlnsec2x+tan2x.y_p=8\cos2x-4\sin4x\ln|\sec2x+\tan2x|.

  y=C1cos4x+C2sin4x+8cos2x4sin4xlnsec2x+tan2x.  \boxed{\;y=C_1\cos4x+C_2\sin4x+8\cos2x-4\sin4x\ln|\sec2x+\tan2x|.\;}


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

Solve y5y=sinxy'-5y=\sin x by variation of parameters.

First-order case. CF: y1=e5xy_1=e^{5x}. Try yp=u(x)e5xy_p=u(x)e^{5x}; substituting: ue5x=sinxu=e5xsinxu'e^{5x}=\sin x\Rightarrow u'=e^{-5x}\sin x.

Using eaxsinbx=eax(asinbxbcosbx)a2+b2\int e^{ax}\sin bx=\tfrac{e^{ax}(a\sin bx-b\cos bx)}{a^2+b^2} with a=5,b=1a=-5,b=1: u=e5x(5sinx+cosx)26    yp=5sinx+cosx26.u=-\frac{e^{-5x}(5\sin x+\cos x)}{26}\;\Rightarrow\;y_p=-\frac{5\sin x+\cos x}{26}.

  y=Ce5x5sinx+cosx26.  \boxed{\;y=Ce^{5x}-\frac{5\sin x+\cos x}{26}.\;}


2017 Paper 1, 2017-P1-Q7b-ii (8 marks)

Solve yy2y=4476x48x2y''-y'-2y=44-76x-48x^2 by variation of parameters.

CF. m2m2=0m=2,1m^2-m-2=0\Rightarrow m=2,-1; y1=exy_1=e^{-x}, y2=e2xy_2=e^{2x}; W=3exW=3e^x.

Using exPdx=ex(PP+P)\int e^x P\,dx=e^x(P-P'+P''-\cdots) with P=4476x48x2P=44-76x-48x^2: u1y1+u2y2=24x2+14x5(exponential factors cancel).u_1y_1+u_2y_2=24x^2+14x-5\qquad(\text{exponential factors cancel}).

  y=C1ex+C2e2x+24x2+14x5.  \boxed{\;y=C_1e^{-x}+C_2e^{2x}+24x^2+14x-5.\;}

Common Traps


vop-cauchy-euler (2 question(s); 2019, 2024)

Recognition Cues

Solution Template

  1. Solve the homogeneous Cauchy-Euler ODE by trying y=xmy=x^m; get the indicial equation.
  2. Write down y1=xm1y_1=x^{m_1} and y2=xm2y_2=x^{m_2}.
  3. Divide the full ODE by x2x^2 to get standard form; read off g(x)g(x) from the normalised RHS.
  4. Compute W=y1y2y2y1W=y_1y_2'-y_2y_1'.
  5. Apply VoP: u1=y2g/Wu_1'=-y_2g/W, u2=y1g/Wu_2'=y_1g/W; integrate; assemble ypy_p.

Worked Example(s)

2019 Paper 1, 2019-P1-Q7a (15 marks) and 2024 Paper 1, 2024-P1-Q6c-ii (10 marks)

Find the independent CF solutions of x2y2xy+2y=x3sinxx^2y''-2xy'+2y=x^3\sin x and find the general solution by variation of parameters.

Sources:,

Indicial equation. Try y=xmy=x^m in x2y2xy+2y=0x^2y''-2xy'+2y=0: m(m1)2m+2=m23m+2=(m1)(m2)=0m(m-1)-2m+2=m^2-3m+2=(m-1)(m-2)=0, giving y1=x,y2=x2.y_1=x,\qquad y_2=x^2.

Standard form. Divide by x2x^2: y(2/x)y+(2/x2)y=xsinxy''-(2/x)y'+(2/x^2)y=x\sin x, so g(x)=xsinxg(x)=x\sin x.

Wronskian. W=x2xx21=x2W=x\cdot2x-x^2\cdot1=x^2.

VoP integrals: u1=x2xsinxx2=xsinx    u1=xcosxsinx.u_1'=-\frac{x^2\cdot x\sin x}{x^2}=-x\sin x\;\Rightarrow\;u_1=x\cos x-\sin x. u2=xxsinxx2=sinx    u2=cosx.u_2'=\frac{x\cdot x\sin x}{x^2}=\sin x\;\Rightarrow\;u_2=-\cos x.

Particular integral: yp=(xcosxsinx)x+(cosx)x2=x2cosxxsinxx2cosx=xsinx.y_p=(x\cos x-\sin x)\cdot x+(-\cos x)\cdot x^2=x^2\cos x-x\sin x-x^2\cos x=-x\sin x.

  y=C1x+C2x2xsinx.  \boxed{\;y=C_1x+C_2x^2-x\sin x.\;}

Common Traps


vop-after-reduction (4 question(s); 2020, 2021, 2022, 2025)

Recognition Cues

Solution Template

  1. Accept the given y1y_1 (or find it by inspection/trial).
  2. Reduction of order: substitute y2=v(x)y1y_2=v(x)y_1 into the homogeneous ODE; reduce to a first-order ODE in u=vu=v'; integrate twice to get vv and hence y2y_2.
  3. Divide the full ODE by its leading coefficient to get standard form; read off g(x)g(x).
  4. Compute W=y1y2y2y1W=y_1y_2'-y_2y_1'.
  5. Apply VoP: u1=y2g/Wu_1'=-y_2g/W, u2=y1g/Wu_2'=y_1g/W; integrate; assemble ypy_p.

Worked Example(s)

2021 Paper 1, 2021-P1-Q8a-ii (10 marks)

Solve x2y2x(1+x)y+2(1+x)y=x3x^2y''-2x(1+x)y'+2(1+x)y=x^3 by variation of parameters, given y1=xy_1=x satisfies the homogeneous equation.

Find y2y_2. Try y2=v(x)xy_2=v(x)\cdot x. Substituting into the homogeneous ODE and simplifying: x3v2x3v=0    v=2v    u=v=e2x    v=e2x/2.x^3v''-2x^3v'=0\;\Rightarrow\;v''=2v'\;\Rightarrow\;u=v'=e^{2x}\;\Rightarrow\;v=e^{2x}/2. Take y2=xe2xy_2=xe^{2x}.

Standard form. Divide by x2x^2: g(x)=x3/x2=xg(x)=x^3/x^2=x.

Wronskian. W=x(1+2x)e2xxe2x1=2x2e2xW=x\cdot(1+2x)e^{2x}-xe^{2x}\cdot1=2x^2e^{2x}.

VoP: u2=xx2x2e2x=12e2xu2=14e2xu_2'=\tfrac{x\cdot x}{2x^2e^{2x}}=\tfrac12e^{-2x}\Rightarrow u_2=-\tfrac14e^{-2x}. Then u1=12u1=x/2u_1'=-\tfrac12\Rightarrow u_1=-x/2.

yp=(x/2)(x)+(e2x/4)(xe2x)=x2/2x/4.y_p=(-x/2)(x)+(-e^{-2x}/4)(xe^{2x})=-x^2/2-x/4.

The x/4-x/4 is absorbed into C1xC_1x:

  y=C1x+C2xe2xx22.  \boxed{\;y=C_1x+C_2xe^{2x}-\frac{x^2}{2}.\;}


2022 Paper 1, 2022-P1-Q6b (15 marks)

Solve (x21)y2xy+2y=(x21)2(x^2-1)y''-2xy'+2y=(x^2-1)^2 by variation of parameters, given y1=xy_1=x.

Find y2y_2. Try y2=vxy_2=vx; substituting into the homogeneous equation: x(x21)v2v=0    dvv=2dxx(x21).x(x^2-1)v''-2v'=0\;\Rightarrow\;\frac{dv'}{v'}=\frac{2\,dx}{x(x^2-1)}. Partial fractions: 2x(x1)(x+1)=2x+1x1+1x+1\tfrac{2}{x(x-1)(x+1)}=-\tfrac2x+\tfrac1{x-1}+\tfrac1{x+1}. Integrating: v=(x21)/x2=11/x2v'=(x^2-1)/x^2=1-1/x^2, so v=x+1/xv=x+1/x and y2=x2+1y_2=x^2+1.

Standard form. Divide by (x21)(x^2-1): g=x21g=x^2-1.

Wronskian. W=x2x(x2+1)1=x21W=x\cdot2x-(x^2+1)\cdot1=x^2-1.

VoP: u2=xu2=x2/2u_2'=x\Rightarrow u_2=x^2/2; u1=(x2+1)u1=x3/3xu_1'=-(x^2+1)\Rightarrow u_1=-x^3/3-x.

yp=(x3/3x)x+(x2/2)(x2+1)=x46x22.y_p=(-x^3/3-x)\cdot x+(x^2/2)\cdot(x^2+1)=\frac{x^4}{6}-\frac{x^2}{2}.

  y=C1x+C2(x2+1)+x46x22.  \boxed{\;y=C_1x+C_2(x^2+1)+\frac{x^4}{6}-\frac{x^2}{2}.\;}


2020 Paper 1, 2020-P1-Q6a (20 marks)

Solve y+(1cotx)yycotx=sin2xy''+(1-\cot x)y'-y\cot x=\sin^2 x by variation of parameters, given y1=exy_1=e^{-x}.

Find y2y_2. Factor the operator: (Dcotx)(D+1)y=0(D-\cot x)(D+1)y=0. Letting v=(D+1)yv=(D+1)y: (Dcotx)v=0v=sinx(D-\cot x)v=0\Rightarrow v=\sin x. Solve (D+1)y=sinx(D+1)y=\sin x: integrating factor exe^x: y2=sinxcosxy_2=\sin x-\cos x.

Wronskian. W=2exsinxW=2e^{-x}\sin x.

VoP: u2=exsin2x2exsinx=sinx2    u2=cosx2.u_2'=\frac{e^{-x}\sin^2 x}{2e^{-x}\sin x}=\frac{\sin x}{2}\;\Rightarrow\;u_2=-\frac{\cos x}{2}. u1=(sinxcosx)sin2x2exsinx=ex4(1cos2xsin2x)    u1=ex20(3sin2xcos2x5).u_1'=-\frac{(\sin x-\cos x)\sin^2 x}{2e^{-x}\sin x}=-\frac{e^x}{4}(1-\cos2x-\sin2x)\;\Rightarrow\;u_1=\frac{e^x}{20}(3\sin2x-\cos2x-5).

Assembling and simplifying (constant terms cancel): yp=110sin2x+15cos2x.y_p=-\frac{1}{10}\sin2x+\frac{1}{5}\cos2x.

  y=C1ex+C2(sinxcosx)sin2x10+cos2x5.  \boxed{\;y=C_1e^{-x}+C_2(\sin x-\cos x)-\frac{\sin2x}{10}+\frac{\cos2x}{5}.\;}


2025 Paper 1, 2025-P1-Q8a (15 marks)

Solve (x+2)y(2x+5)y+2y=(1+x)ex(x+2)y''-(2x+5)y'+2y=(1+x)e^x by variation of parameters.

CF by inspection. Try y=emxy=e^{mx}: matching coefficients of xx gives m=2m=2, yielding y1=e2xy_1=e^{2x}. Try y=αx+βy=\alpha x+\beta: gives y2=2x+5y_2=2x+5.

Standard form. Divide by (x+2)(x+2): g=(1+x)ex/(x+2)g=(1+x)e^x/(x+2).

Wronskian. W=4(x+2)e2xW=-4(x+2)e^{2x}.

VoP: u2=(x+1)ex4(x+2)2u_2'=-\tfrac{(x+1)e^x}{4(x+2)^2}; use ddx ⁣exx+2=(x+1)ex(x+2)2\tfrac{d}{dx}\!\tfrac{e^x}{x+2}=\tfrac{(x+1)e^x}{(x+2)^2}, so u2=ex4(x+2)u_2=-\tfrac{e^x}{4(x+2)}.

After assembling, both terms combine to give yp=exy_p=-e^x.

  y=C1e2x+C2(2x+5)ex.  \boxed{\;y=C_1e^{2x}+C_2(2x+5)-e^x.\;}

Common Traps


Marks-Aware Writing

8-mark questions (2017): CF + Wronskian (one line each), two VoP integrals (show clearly), assemble and simplify. Since forcing is polynomial, the exponentials in u1y1+u2y2u_1y_1+u_2y_2 cancel — state this explicitly.

10-mark questions (2013, 2014, 2024): Write CF and Wronskian; show both integrands; integrate; write ypy_p neatly; state the general solution. Four to five working lines suffice.

13-15-mark questions (2016, 2018, 2019, 2022, 2025): Full layout — CF with justification, Wronskian calculation (show the 2×22\times2 determinant), both integrands and their integrals step by step, assembled ypy_p, boxed final answer.

20-mark questions (2020): All of the above, plus the derivation of y2y_2 (operator factorisation or reduction of order written out in full), Wronskian computation, all four integrals shown. Double-check the constant cancellations.

Practice Set

YearPaper/QMarksArchetypeOne-line hint
2025P1-Q8a15vop-after-reductionCF: e2xe^{2x} and 2x+52x+5 by inspection; W=4(x+2)e2xW=-4(x+2)e^{2x}; yp=exy_p=-e^x telescopes neatly
2024P1-Q6c-ii10vop-cauchy-eulerSame as 2019; indicial roots 1,2; g=xsinxg=x\sin x; yp=xsinxy_p=-x\sin x
2022P1-Q6b15vop-after-reductionPartial fractions to find v=(x21)/x2v'=(x^2-1)/x^2; y2=x2+1y_2=x^2+1; yp=x4/6x2/2y_p=x^4/6-x^2/2
2021P1-Q8a-ii10vop-after-reductiony2=xe2xy_2=xe^{2x} from v=2vv''=2v'; standard form g=xg=x; yp=x2/2y_p=-x^2/2
2020P1-Q6a20vop-after-reductionOperator factor (Dcotx)(D+1)(D-\cot x)(D+1); y2=sinxcosxy_2=\sin x-\cos x; yp=110sin2x+15cos2xy_p=-\tfrac{1}{10}\sin2x+\tfrac15\cos2x
2019P1-Q7a15vop-cauchy-eulerIndicial roots 1,2; g=xsinxg=x\sin x after dividing by x2x^2; yp=xsinxy_p=-x\sin x
2018P1-Q6c13variation-of-parametersW=4W=4; double-angle identities; $y_p=8\cos2x-4\sin4x\ln
2017P1-Q7b-ii8variation-of-parametersW=3exW=3e^x; exPdx\int e^xP\,dx shortcut; exponentials cancel; yp=24x2+14x5y_p=24x^2+14x-5
2016P1-Q6b15variation-of-parametersRepeated root; W=e2xW=e^{-2x}; xlogx\int x\log x and logx\int\log x; yp=ex(x22logx3x24)y_p=e^{-x}(\tfrac{x^2}{2}\log x-\tfrac{3x^2}{4})
2014P1-Q6a10variation-of-parametersFirst-order VoP; e5xsinxdx\int e^{-5x}\sin x\,dx; denominator 26; yp=(5sinx+cosx)/26y_p=-(5\sin x+\cos x)/26
2013P1-Q6b10variation-of-parametersW=aW=a; $\int\tan ax=-\tfrac{1}{a}\ln

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