The Wronskian & Variation of Parameters

Study Sheet

The Wronskian & Variation of Parameters

Independence certificates, and the method that handles any forcing

The General Machinery

Tip
The Wronskian certifies independence

For solutions y1,y2y_1, y_2 of the same second-order linear homogeneous equation, the Wronskian W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2 is either never zero or identically zero (Abel's theorem: W=Ce−∫p dxW = Ce^{-\int p\,dx}).

Why this determinant: to match arbitrary data y(x0)=ay(x_0) = a, y′(x0)=by'(x_0) = b with c1y1+c2y2c_1y_1 + c_2y_2, you must solve c1y1(x0)+c2y2(x0)=ac_1y_1(x_0) + c_2y_2(x_0) = a and c1y1′(x0)+c2y2′(x0)=bc_1y_1'(x_0) + c_2y_2'(x_0) = b — a linear system whose determinant is W(x0)W(x_0). Nonzero WW means {y1,y2}\{y_1, y_2\} is a fundamental set — every solution is a combination of them, and every initial-value problem is solvable within their span. Computing WW is a 2×22\times2 determinant: for cos⁡βx,sin⁡βx\cos\beta x, \sin\beta x it is the constant β\beta.

Tip
Variation of parameters: the universal particular solution

For y′′+py′+qy=fy'' + p y' + q y = f with fundamental pair y1,y2y_1, y_2: seek yp=u1y1+u2y2y_p = u_1y_1 + u_2y_2 with functions uiu_i. Imposing the standard side condition u1′y1+u2′y2=0u_1'y_1 + u_2'y_2 = 0 leads to u1′=−y2fWu_1' = -\dfrac{y_2 f}{W}, u2′=y1fWu_2' = \dfrac{y_1 f}{W} — two integrations and done.

Unlike undetermined coefficients this needs no guess and works for any continuous forcing: sec⁡x\sec x, exx\tfrac{e^x}{x}, ln⁡x\ln x. The cost is two possibly-ugly integrals; the gain is universality. The side condition is a choice, not a law: two unknown functions leave room for two conditions, and this one keeps u1′,u2′u_1', u_2' out of yp′y_p', so that yp′′y_p'' contains only first derivatives of the uiu_i and the equation becomes a linear system for u1′u_1' and u2′u_2'.

Example
Worked: y″ + y = sec x, which no guess can touch
xy−1.5−1−0.50.5112sec xyₚ
yp=cos⁡xln⁡(cos⁡x)+xsin⁡xy_p = \cos x\ln(\cos x) + x\sin x (solid), the response from rest to the forcing sec⁡x\sec x (dashed), on ∣x∣<π2|x| < \tfrac\pi2.

Step 1 — fundamental pair: y1=cos⁡xy_1 = \cos x, y2=sin⁡xy_2 = \sin x, W=1W = 1.

Step 2 — the formulas: u1′=−sin⁡xsec⁡x=−tan⁡xu_1' = -\sin x\sec x = -\tan x and u2′=cos⁡xsec⁡x=1u_2' = \cos x\sec x = 1.

Step 3 — integrate: u1=ln⁡(cos⁡x)u_1 = \ln(\cos x), u2=xu_2 = x.

Step 4 — assemble: yp=cos⁡x ln⁡(cos⁡x)+xsin⁡xy_p = \cos x\,\ln(\cos x) + x\sin x.

Step 5 — sanity: the xsin⁡xx\sin x piece echoes resonance (sec⁡x\sec x contains the natural frequency), and differentiating twice confirms yp′′+yp=sec⁡xy_p'' + y_p = \sec x ✓.

Step 6 — where it lives: sec⁡x\sec x is continuous only on ∣x∣<π2|x| < \tfrac\pi2 (there cos⁡x>0\cos x > 0, so ln⁡(cos⁡x)\ln(\cos x) makes sense), and on that interval yp(0)=0y_p(0) = 0 and yp′(0)=−sin⁡0 ln⁡(cos⁡0)+0=0y_p'(0) = -\sin 0\,\ln(\cos 0) + 0 = 0: this ypy_p is the response of the system started from rest.

Side note
Significance: the Wronskian outlives the course

Wronskians appear wherever independence of functions matters: quantum mechanics uses them to normalize scattering states, and numerical ODE solvers monitor them to detect degenerating solution bases. Variation of parameters, meanwhile, is the finite-dimensional ancestor of the "Green's function" method that solves PDEs by superposing impulse responses.

Try it
Try it: a Wronskian in one line

Compute W(e2x,xe2x)W(e^{2x}, xe^{2x}) and decide whether the pair is a fundamental set for y′′−4y′+4y=0y'' - 4y' + 4y = 0.

Show the answer

With y1=e2xy_1 = e^{2x} and y2=xe2xy_2 = xe^{2x}: y1′=2e2xy_1' = 2e^{2x} and y2′=(1+2x)e2xy_2' = (1 + 2x)e^{2x}. So W=y1y2′−y1′y2=e2x(1+2x)e2x−2e2x⋅xe2x=e4xW = y_1y_2' - y_1'y_2 = e^{2x}(1 + 2x)e^{2x} - 2e^{2x}\cdot xe^{2x} = e^{4x}. It is never zero, so the two solutions are independent and form a fundamental set: every solution is (A+Bx)e2x(A + Bx)e^{2x}. Abel's formula agrees: p=−4p = -4 gives W=Ce4xW = Ce^{4x}.

Variation of Parameters, Worked in Full

Tip
The formula in one line

With y1,y2y_1, y_2 a fundamental pair for y′′+p(x)y′+q(x)y=0y'' + p(x)y' + q(x)y = 0 and W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2,

yp=−y1∫y2fW dx+y2∫y1fW dx,y_p = -y_1\int\frac{y_2 f}{W}\,dx + y_2\int\frac{y_1 f}{W}\,dx,

where ff is the right side after dividing the equation by the coefficient of y′′y''. Constants of integration may be dropped: they only add c1y1+c2y2c_1y_1 + c_2y_2, which the homogeneous part already contains.

The formula is Cramer's rule for the two conditions on u1′,u2′u_1', u_2': the side condition u1′y1+u2′y2=0u_1'y_1 + u_2'y_2 = 0 and the equation's requirement u1′y1′+u2′y2′=fu_1'y_1' + u_2'y_2' = f. The coefficient matrix has determinant WW, never zero for a fundamental pair, so the system always has a solution — that is why the method cannot fail when ff is continuous. The ff must come from the equation with leading coefficient 11, because the derivation substitutes into y′′+py′+qy=fy'' + py' + qy = f.

Example
Worked: a forcing we can check by guessing
xy1234562yₚ = 2
y=2−2cos⁡2xy = 2 - 2\cos 2x from rest: the homogeneous part swings about the particular solution yp=2y_p = 2 (dashed).

Find ypy_p for y′′+4y=8y'' + 4y = 8 by variation of parameters, and compare with undetermined coefficients.

Step 1 — y1=cos⁡2xy_1 = \cos 2x, y2=sin⁡2xy_2 = \sin 2x, and W=cos⁡2x⋅2cos⁡2x−(−2sin⁡2x)sin⁡2x=2W = \cos 2x\cdot 2\cos 2x - (-2\sin 2x)\sin 2x = 2.

Step 2 — u1′=−sin⁡2x⋅82=−4sin⁡2xu_1' = -\dfrac{\sin 2x\cdot 8}{2} = -4\sin 2x and u2′=cos⁡2x⋅82=4cos⁡2xu_2' = \dfrac{\cos 2x\cdot 8}{2} = 4\cos 2x.

Step 3 — integrate: u1=2cos⁡2xu_1 = 2\cos 2x and u2=2sin⁡2xu_2 = 2\sin 2x.

Step 4 — yp=2cos⁡22x+2sin⁡22x=2y_p = 2\cos^2 2x + 2\sin^2 2x = 2.

Step 5 — compare: guessing a constant yp=Ay_p = A gives 4A=84A = 8, so A=2A = 2, the same answer. The machinery is heavier than needed here, but it produces exactly what guessing produces whenever guessing works.

Step 6 — from rest, y(0)=y′(0)=0y(0) = y'(0) = 0 forces c1=−2c_1 = -2, c2=0c_2 = 0: y=2−2cos⁡2xy = 2 - 2\cos 2x, which oscillates between 00 and 44 about yp=2y_p = 2.

Example
Worked: y″ + y = tan x

Solve y′′+y=tan⁡xy'' + y = \tan x on ∣x∣<π2|x| < \tfrac\pi2.

Step 1 — y1=cos⁡xy_1 = \cos x, y2=sin⁡xy_2 = \sin x, W=1W = 1.

Step 2 — u1′=−sin⁡xtan⁡x=−sin⁡2xcos⁡x=cos⁡x−sec⁡xu_1' = -\sin x\tan x = -\dfrac{\sin^2 x}{\cos x} = \cos x - \sec x, using sin⁡2x=1−cos⁡2x\sin^2 x = 1 - \cos^2 x to split the fraction into integrable pieces; and u2′=cos⁡xtan⁡x=sin⁡xu_2' = \cos x\tan x = \sin x.

Step 3 — integrate: u1=sin⁡x−ln⁡(sec⁡x+tan⁡x)u_1 = \sin x - \ln(\sec x + \tan x) and u2=−cos⁡xu_2 = -\cos x.

Step 4 — assemble: yp=cos⁡xsin⁡x−cos⁡xln⁡(sec⁡x+tan⁡x)−sin⁡xcos⁡x=−cos⁡xln⁡(sec⁡x+tan⁡x)y_p = \cos x\sin x - \cos x\ln(\sec x + \tan x) - \sin x\cos x = -\cos x\ln(\sec x + \tan x).

Step 5 — the general solution is y=c1cos⁡x+c2sin⁡x−cos⁡xln⁡(sec⁡x+tan⁡x)y = c_1\cos x + c_2\sin x - \cos x\ln(\sec x + \tan x). Undetermined coefficients could not have found this: tan⁡x\tan x has infinitely many independent derivatives, so there is no finite family to guess from.

Example
Worked: a Cauchy–Euler equation, standard form first

Solve x2y′′−2xy′+2y=x3x^2y'' - 2xy' + 2y = x^3 for x>0x > 0, given that y1=xy_1 = x and y2=x2y_2 = x^2 solve the homogeneous equation.

Step 1 — check the pair: for y=xy = x, 0−2x+2x=00 - 2x + 2x = 0 ✓; for y=x2y = x^2, 2x2−4x2+2x2=02x^2 - 4x^2 + 2x^2 = 0 ✓. Their Wronskian is W=x⋅2x−1⋅x2=x2W = x\cdot 2x - 1\cdot x^2 = x^2.

Step 2 — standard form: dividing by x2x^2 gives y′′−2x y′+2x2 y=xy'' - \dfrac2x\,y' + \dfrac{2}{x^2}\,y = x, so f=xf = x.

Step 3 — u1′=−x2⋅xx2=−xu_1' = -\dfrac{x^2\cdot x}{x^2} = -x and u2′=x⋅xx2=1u_2' = \dfrac{x\cdot x}{x^2} = 1.

Step 4 — u1=−x22u_1 = -\tfrac{x^2}{2} and u2=xu_2 = x, so yp=−x32+x3=x32y_p = -\tfrac{x^3}{2} + x^3 = \tfrac{x^3}{2}.

Step 5 — verify in the original equation: x2⋅3x−2x⋅3x22+2⋅x32=3x3−3x3+x3=x3x^2\cdot 3x - 2x\cdot\tfrac{3x^2}{2} + 2\cdot\tfrac{x^3}{2} = 3x^3 - 3x^3 + x^3 = x^3 ✓. The general solution is y=c1x+c2x2+x32y = c_1x + c_2x^2 + \tfrac{x^3}{2}.

Side note
Where it goes wrong: f read off before dividing

In the last example, using f=x3f = x^3 (the right side as printed) instead of f=xf = x gives u1′=−x3u_1' = -x^3 and u2′=x2u_2' = x^2, so yp=−x54+x53=x512y_p = -\tfrac{x^5}{4} + \tfrac{x^5}{3} = \tfrac{x^5}{12}. Substituting: x2⋅20x312−2x⋅5x412+2⋅x512=x5x^2\cdot\tfrac{20x^3}{12} - 2x\cdot\tfrac{5x^4}{12} + 2\cdot\tfrac{x^5}{12} = x^5, not x3x^3. The formula solved a different equation, off by exactly the leading coefficient x2x^2.

Try it
Try it: a forcing with no guess

Find a particular solution of y′′−2y′+y=ex1+x2y'' - 2y' + y = \dfrac{e^x}{1 + x^2}.

Show the answer

Homogeneous: (r−1)2=0(r - 1)^2 = 0, so y1=exy_1 = e^x and y2=xexy_2 = xe^x, with W=e2xW = e^{2x} (the Try-it above, with 11 in place of 22). Then u1′=−xex⋅ex/(1+x2)e2x=−x1+x2u_1' = -\dfrac{xe^x\cdot e^x/(1 + x^2)}{e^{2x}} = -\dfrac{x}{1 + x^2} and u2′=ex⋅ex/(1+x2)e2x=11+x2u_2' = \dfrac{e^x\cdot e^x/(1 + x^2)}{e^{2x}} = \dfrac{1}{1 + x^2}. Integrate: u1=−12ln⁡(1+x2)u_1 = -\tfrac12\ln(1 + x^2) and u2=arctan⁡xu_2 = \arctan x. So yp=ex(xarctan⁡x−12ln⁡(1+x2))y_p = e^x\left(x\arctan x - \tfrac12\ln(1 + x^2)\right).

Abel's Formula and Reduction of Order

Tip
A second solution from the first

If y1y_1 solves y′′+p(x)y′+q(x)y=0y'' + p(x)y' + q(x)y = 0, a second, independent solution is

y2=y1∫Wy12 dx,W=e−∫p dx.y_2 = y_1\int\frac{W}{y_1^2}\,dx, \qquad W = e^{-\int p\,dx}.

Abel's formula gives WW from pp alone, before any second solution is known.

By the quotient rule, (y2y1)′=y1y2′−y1′y2y12=Wy12\left(\dfrac{y_2}{y_1}\right)' = \dfrac{y_1y_2' - y_1'y_2}{y_1^2} = \dfrac{W}{y_1^2}. Abel's theorem says W=Ce−∫pW = Ce^{-\int p} for any pair of solutions, so choosing C=1C = 1 and integrating once recovers the ratio y2y1\tfrac{y_2}{y_1}, hence y2y_2. Because W≠0W \ne 0, the ratio is not constant, so y2y_2 really is independent of y1y_1.

Example
Worked: Abel without solving

The equation x2y′′+xy′−4y=0x^2y'' + xy' - 4y = 0 on x>0x > 0 has the solutions y1=x2y_1 = x^2 and y2=x−2y_2 = x^{-2}. Predict their Wronskian from Abel's formula, then check it.

Step 1 — standard form: y′′+1x y′−4x2 y=0y'' + \dfrac1x\,y' - \dfrac{4}{x^2}\,y = 0, so p=1xp = \dfrac1x and W=Ce−ln⁡x=CxW = Ce^{-\ln x} = \dfrac Cx.

Step 2 — direct computation: W=x2⋅(−2x−3)−2x⋅x−2=−2x−2x=−4xW = x^2\cdot(-2x^{-3}) - 2x\cdot x^{-2} = -\dfrac2x - \dfrac2x = -\dfrac4x.

Step 3 — this has Abel's shape with C=−4C = -4, and it is never zero for x>0x > 0, so x2x^2 and x−2x^{-2} form a fundamental set.

Example
Worked: reduction of order at a double root

Given that y1=x2y_1 = x^2 solves x2y′′−3xy′+4y=0x^2y'' - 3xy' + 4y = 0 on x>0x > 0, find a second solution.

Step 1 — check: x2⋅2−3x⋅2x+4x2=0x^2\cdot 2 - 3x\cdot 2x + 4x^2 = 0 ✓.

Step 2 — standard form gives p=−3xp = -\dfrac3x, so W=e∫3/x dx=x3W = e^{\int 3/x\,dx} = x^3.

Step 3 — y2=x2∫x3x4 dx=x2ln⁡xy_2 = x^2\displaystyle\int\frac{x^3}{x^4}\,dx = x^2\ln x.

Step 4 — verify: y2′=2xln⁡x+xy_2' = 2x\ln x + x and y2′′=2ln⁡x+3y_2'' = 2\ln x + 3, so x2(2ln⁡x+3)−3x(2xln⁡x+x)+4x2ln⁡x=0x^2(2\ln x + 3) - 3x(2x\ln x + x) + 4x^2\ln x = 0 ✓. The indicial equation r(r−1)−3r+4=(r−2)2r(r - 1) - 3r + 4 = (r - 2)^2 has a double root, and ln⁡x\ln x plays the role that the extra factor xx plays for constant coefficients.

Side note
Where it goes wrong: W = 0 without dependence
xy−11−2−11x²x|x|
x2x^2 (solid) and x∣x∣x|x| (dashed where it differs): equal for x>0x > 0, opposite for x<0x < 0.

The functions y1=x2y_1 = x^2 and y2=x∣x∣y_2 = x|x| have W=0W = 0 at every xx (for x>0x > 0 they coincide; for x<0x < 0, y2=−y1y_2 = -y_1), yet no single constant cc gives y2=cy1y_2 = cy_1 on the whole line, so they are independent. This does not contradict Abel's all-or-nothing theorem, which is about two solutions of one equation y′′+py′+qy=0y'' + py' + qy = 0 with continuous p,qp, q; no such equation on an interval containing 00 has both of these as solutions. Only for solutions does W=0W = 0 settle dependence.

Try it
Try it: reduction of order

Check that y1=exy_1 = e^x solves xy′′−(x+1)y′+y=0xy'' - (x + 1)y' + y = 0 on x>0x > 0, and find a second solution.

Show the answer

Check: xex−(x+1)ex+ex=0xe^x - (x + 1)e^x + e^x = 0 ✓. Standard form: p=−x+1x=−1−1xp = -\dfrac{x + 1}{x} = -1 - \dfrac1x, so −∫p dx=x+ln⁡x-\int p\,dx = x + \ln x and W=ex+ln⁡x=xexW = e^{x + \ln x} = xe^x. Then y2=ex∫xexe2x dx=ex∫xe−x dx=ex⋅(−(x+1)e−x)=−(x+1)y_2 = e^x\displaystyle\int\frac{xe^x}{e^{2x}}\,dx = e^x\int xe^{-x}\,dx = e^x\cdot\left(-(x + 1)e^{-x}\right) = -(x + 1). Any nonzero multiple is also a solution, so take y2=x+1y_2 = x + 1. Check: x⋅0−(x+1)⋅1+(x+1)=0x\cdot 0 - (x + 1)\cdot 1 + (x + 1) = 0 ✓.

Proofs & Why It Matters

Tip
Proof: the variation-of-parameters formulas

With yp=u1y1+u2y2y_p = u_1y_1 + u_2y_2 and side condition u1′y1+u2′y2=0u_1'y_1 + u_2'y_2 = 0: then yp′=u1y1′+u2y2′y_p' = u_1y_1' + u_2y_2', and yp′′=u1′y1′+u2′y2′+u1y1′′+u2y2′′y_p'' = u_1'y_1' + u_2'y_2' + u_1y_1'' + u_2y_2''. Substitute into the ODE; the uiu_i-times-homogeneous-solution terms vanish (each yiy_i solves the homogeneous equation), leaving u1′y1′+u2′y2′=fu_1'y_1' + u_2'y_2' = f.

Together with the side condition this is a 2×22\times2 linear system in u1′,u2′u_1', u_2' whose determinant is exactly WW; Cramer's rule gives u1′=−y2f/Wu_1' = -y_2f/W, u2′=y1f/Wu_2' = y_1f/W. ■\blacksquare

Tip
Proof: Abel's theorem

Differentiate W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2: W′=y1y2′′−y1′′y2W' = y_1y_2'' - y_1''y_2 (the cross terms cancel). Substitute yi′′=−pyi′−qyiy_i'' = -py_i' - qy_i: W′=y1(−py2′−qy2)−(−py1′−qy1)y2=−p(y1y2′−y1′y2)=−pWW' = y_1(-py_2' - qy_2) - (-py_1' - qy_1)y_2 = -p(y_1y_2' - y_1'y_2) = -pW. So W=Ce−∫pW = Ce^{-\int p} — never zero unless C=0C = 0, in which case it vanishes identically. Independence is an all-or-nothing affair. ■\blacksquare

Going Deeper: Worked Problems

Example
Worked: variation of parameters with a non-standard forcing

Solve y′′−2y′+y=exxy'' - 2y' + y = \dfrac{e^x}{x} for x>0x > 0.

Step 1 — homogeneous: (r−1)2=0(r-1)^2 = 0, double root: y1=exy_1 = e^x, y2=xexy_2 = xe^x.

Step 2 — Wronskian: W=ex(ex+xex)−ex⋅xex=e2xW = e^x(e^x + xe^x) - e^x\cdot xe^x = e^{2x}.

Step 3 — the formulas with f=exxf = \tfrac{e^x}{x}: u1′=−y2fW=−xex⋅ex/xe2x=−1u_1' = -\dfrac{y_2f}{W} = -\dfrac{xe^x\cdot e^x/x}{e^{2x}} = -1, and u2′=y1fW=ex⋅ex/xe2x=1xu_2' = \dfrac{y_1f}{W} = \dfrac{e^x\cdot e^x/x}{e^{2x}} = \dfrac1x.

Step 4 — integrate: u1=−xu_1 = -x, u2=ln⁡xu_2 = \ln x.

Step 5 — yp=−xex+xexln⁡xy_p = -xe^x + xe^x\ln x; the −xex-xe^x is a homogeneous solution and can be dropped: yp=xexln⁡xy_p = xe^x\ln x. General solution: y=(c1+c2x)ex+xexln⁡xy = (c_1 + c_2x)e^x + xe^x\ln x. Undetermined coefficients has no guess for exx\tfrac{e^x}{x} — this method never needed one.

Example
Worked: using the Wronskian to test a claimed fundamental set

Are y1=xy_1 = x and y2=xln⁡xy_2 = x\ln x a fundamental set of solutions of x2y′′−xy′+y=0x^2y'' - xy' + y = 0 on x>0x > 0?

Step 1 — check each solves the equation: for y=xy = x: 0−x+x=00 - x + x = 0 ✓; for y=xln⁡xy = x\ln x: y′=ln⁡x+1y' = \ln x + 1, y′′=1xy'' = \tfrac1x, so x2⋅1x−x(ln⁡x+1)+xln⁡x=x−xln⁡x−x+xln⁡x=0x^2\cdot\tfrac1x - x(\ln x + 1) + x\ln x = x - x\ln x - x + x\ln x = 0 ✓.

Step 2 — Wronskian: W=x(ln⁡x+1)−1⋅xln⁡x=xW = x(\ln x + 1) - 1\cdot x\ln x = x, nonzero for x>0x > 0.

Step 3 — conclusion: yes — independent solutions, so every solution is c1x+c2xln⁡xc_1x + c_2x\ln x.

Step 4 — connect: this is a Cauchy–Euler equation with double indicial root r=1r = 1, and the ln⁡x\ln x companion is the x=etx = e^t shadow of the tertte^{rt} rule. The Wronskian being exactly xx matches Abel's formula W=Ce−∫pW = Ce^{-\int p} with p=−1xp = -\tfrac1x.