Skip to content

Second-Order Linear ODEs

3.1 General Theory

A second-order linear ODE has the form

y+p(x)y+q(x)y=g(x)y'' + p(x)y' + q(x)y = g(x)

Theorem 3.1. If y1y_1 and y2y_2 are solutions of the homogeneous equation y+py+qy=0y'' + py' + qy = 0 Then c1y1+c2y2c_1 y_1 + c_2 y_2 is also a solution (superposition principle).

Theorem 3.2 (Wronskian Criterion). Two solutions y1,y2y_1, y_2 of the homogeneous equation form a fundamental set (i.e., span all solutions) if and only if their Wronskian is non-zero:

W(y1,y2)(x)=y1y2y1y20W(y_1, y_2)(x) = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix} \neq 0

Abel’s identity states that W(x)=W(x0)ex0xp(t)dtW(x) = W(x_0) e^{-\int_{x_0}^x p(t)\, dt}.

Theorem 3.3. The general solution of y+py+qy=gy'' + py' + qy = g is y=yh+ypy = y_h + y_pWhere yhy_h is the General solution of the homogeneous equation and ypy_p is any particular solution.

3.2 Homogeneous Equations with Constant Coefficients

For y+ay+by=0y'' + ay' + by = 0 with a,ba, b constants, try y=erxy = e^{rx}:

r2+ar+b=0r^2 + ar + b = 0

Case 1: Two distinct real roots r1r2r_1 \neq r_2. yh=c1er1x+c2er2xy_h = c_1 e^{r_1 x} + c_2 e^{r_2 x}.

Case 2: Repeated root rr. yh=c1erx+c2xerxy_h = c_1 e^{rx} + c_2 x e^{rx}.

Case 3: Complex conjugate roots r=α±iβr = \alpha \pm i\beta. yh=eαx(c1cos(βx)+c2sin(βx))y_h = e^{\alpha x}(c_1 \cos(\beta x) + c_2 \sin(\beta x)).

3.3 Worked Example: Homogeneous Equation

Problem. Solve y5y+6y=0y'' - 5y' + 6y = 0 with y(0)=1y(0) = 1, y(0)=0y'(0) = 0.

Solution. Characteristic equation: r25r+6=(r2)(r3)=0r^2 - 5r + 6 = (r-2)(r-3) = 0. Roots: r=2,3r = 2, 3.

yh=c1e2x+c2e3xy_h = c_1 e^{2x} + c_2 e^{3x}.

y(0)=c1+c2=1y(0) = c_1 + c_2 = 1. y(0)=2c1+3c2=0y'(0) = 2c_1 + 3c_2 = 0. Solving: c1=3c_1 = 3, c2=2c_2 = -2.

y=3e2x2e3xy = 3e^{2x} - 2e^{3x}. \blacksquare

3.4 Worked Example: Complex Roots

Problem. Solve y+2y+5y=0y'' + 2y' + 5y = 0 with y(0)=1y(0) = 1, y(0)=0y'(0) = 0.

Solution

Solution. Characteristic equation: r2+2r+5=0r^2 + 2r + 5 = 0.

r=2±4202=2±162=1±2ir = \frac{-2 \pm \sqrt{4 - 20}}{2} = \frac{-2 \pm \sqrt{-16}}{2} = -1 \pm 2i.

So α=1\alpha = -1, β=2\beta = 2.

y=ex(c1cos(2x)+c2sin(2x))y = e^{-x}(c_1 \cos(2x) + c_2 \sin(2x)).

y(0)=c1=1y(0) = c_1 = 1.

y=ex(cos(2x)+c2sin(2x))+ex(2sin(2x)+2c2cos(2x))y' = -e^{-x}(\cos(2x) + c_2 \sin(2x)) + e^{-x}(-2\sin(2x) + 2c_2 \cos(2x)).

y(0)=1+2c2=0    c2=1/2y'(0) = -1 + 2c_2 = 0 \implies c_2 = 1/2.

y=ex(cos(2x)+12sin(2x))y = e^{-x}\left(\cos(2x) + \frac{1}{2}\sin(2x)\right). \blacksquare

3.5 Worked Example: Repeated Roots

Problem. Solve y4y+4y=0y'' - 4y' + 4y = 0 with y(0)=1y(0) = 1, y(0)=3y'(0) = 3.

Solution

Solution. Characteristic equation: r24r+4=(r2)2=0r^2 - 4r + 4 = (r - 2)^2 = 0. Repeated root r=2r = 2.

y=c1e2x+c2xe2xy = c_1 e^{2x} + c_2 xe^{2x}.

y(0)=c1=1y(0) = c_1 = 1.

y=2c1e2x+c2e2x+2c2xe2xy' = 2c_1 e^{2x} + c_2 e^{2x} + 2c_2 xe^{2x}.

y(0)=2c1+c2=3    2+c2=3    c2=1y'(0) = 2c_1 + c_2 = 3 \implies 2 + c_2 = 3 \implies c_2 = 1.

y=e2x+xe2x=e2x(1+x)y = e^{2x} + xe^{2x} = e^{2x}(1 + x). \blacksquare

3.6 Nonhomogeneous Equations: Undetermined Coefficients

For equations y+ay+by=g(x)y'' + ay' + by = g(x) where g(x)g(x) is a polynomial, exponential, sine, cosine, or Products of these, guess the form of ypy_p and solve for coefficients.

g(x)g(x)Guess for ypy_p
Pn(x)P_n(x)Anxn++A0A_n x^n + \cdots + A_0
eaxe^{ax}AeaxAe^{ax}
sin(bx)\sin(bx) or cos(bx)\cos(bx)Asin(bx)+Bcos(bx)A\sin(bx) + B\cos(bx)
eaxPn(x)e^{ax} P_n(x)eax(Anxn++A0)e^{ax}(A_n x^n + \cdots + A_0)
eaxsin(bx)e^{ax}\sin(bx) or eaxcos(bx)e^{ax}\cos(bx)eax(Asin(bx)+Bcos(bx))e^{ax}(A\sin(bx) + B\cos(bx))

Rule. If any term of the guess is a solution of the homogeneous equation, multiply by xx (or x2x^2 if already multiplied by xx).

3.7 Worked Example: Undetermined Coefficients

Problem. Solve yy=2exy'' - y = 2e^x.

Solution. Homogeneous: r21=0r^2 - 1 = 0Roots ±1\pm 1. yh=c1ex+c2exy_h = c_1 e^x + c_2 e^{-x}.

Since exe^x is a homogeneous solution, guess yp=Axexy_p = Axe^x. yp=Aex+Axexy_p' = Ae^x + Axe^x yp=2Aex+Axexy_p'' = 2Ae^x + Axe^x. ypyp=(2Aex+Axex)Axex=2Aex=2exy_p'' - y_p = (2Ae^x + Axe^x) - Axe^x = 2Ae^x = 2e^xSo A=1A = 1.

y=c1ex+c2ex+xexy = c_1 e^x + c_2 e^{-x} + xe^x. \blacksquare

3.8 Worked Example: Undetermined Coefficients with Polynomial

Problem. Solve y+3y+2y=x2+1y'' + 3y' + 2y = x^2 + 1.

Solution

Solution. Homogeneous: r2+3r+2=(r+1)(r+2)=0r^2 + 3r + 2 = (r+1)(r+2) = 0Roots 1,2-1, -2.

yh=c1ex+c2e2xy_h = c_1 e^{-x} + c_2 e^{-2x}.

Guess yp=Ax2+Bx+Cy_p = Ax^2 + Bx + C. Then yp=2Ax+By_p' = 2Ax + B, yp=2Ay_p'' = 2A.

Substituting: 2A+3(2Ax+B)+2(Ax2+Bx+C)=x2+12A + 3(2Ax + B) + 2(Ax^2 + Bx + C) = x^2 + 1.

2A+6Ax+3B+2Ax2+2Bx+2C=x2+12A + 6Ax + 3B + 2Ax^2 + 2Bx + 2C = x^2 + 1.

Matching coefficients:

  • x2x^2: 2A=1    A=1/22A = 1 \implies A = 1/2
  • xx: 6A+2B=0    3+2B=0    B=3/26A + 2B = 0 \implies 3 + 2B = 0 \implies B = -3/2
  • Constant: 2A+3B+2C=1    19/2+2C=1    2C=9/2    C=9/42A + 3B + 2C = 1 \implies 1 - 9/2 + 2C = 1 \implies 2C = 9/2 \implies C = 9/4

yp=x223x2+94y_p = \frac{x^2}{2} - \frac{3x}{2} + \frac{9}{4}.

y=c1ex+c2e2x+x223x2+94y = c_1 e^{-x} + c_2 e^{-2x} + \frac{x^2}{2} - \frac{3x}{2} + \frac{9}{4}. \blacksquare

3.8b Worked Example: Undetermined Coefficients with Product

Problem. Solve y+2y+y=3exsinxy'' + 2y' + y = 3e^{-x}\sin x.

Solution

Solution. Homogeneous: r2+2r+1=(r+1)2=0r^2 + 2r + 1 = (r+1)^2 = 0. Repeated root r=1r = -1.

yh=c1ex+c2xexy_h = c_1 e^{-x} + c_2 xe^{-x}.

The forcing is exsinxe^{-x}\sin xSo guess yp=ex(Asinx+Bcosx)y_p = e^{-x}(A\sin x + B\cos x).

yp=ex(Asinx+Bcosx)+ex(AcosxBsinx)=ex((AB)cosx(A+B)sinx)y_p' = -e^{-x}(A\sin x + B\cos x) + e^{-x}(A\cos x - B\sin x) = e^{-x}((A - B)\cos x - (A + B)\sin x).

yp=ex((AB)cosx(A+B)sinx)+ex((AB)sinx(A+B)cosx)y_p'' = -e^{-x}((A - B)\cos x - (A + B)\sin x) + e^{-x}(-(A - B)\sin x - (A + B)\cos x)

=ex(2Acosx+2Bsinx)= e^{-x}(-2A\cos x + 2B\sin x).

yp+2yp+yp=ex(2Acosx+2Bsinx)+2ex((AB)cosx(A+B)sinx)+ex(Asinx+Bcosx)y_p'' + 2y_p' + y_p = e^{-x}(-2A\cos x + 2B\sin x) + 2e^{-x}((A - B)\cos x - (A + B)\sin x) + e^{-x}(A\sin x + B\cos x)

=ex[(2A+2A2B+B)cosx+(2B2A2B+A)sinx]= e^{-x}[(-2A + 2A - 2B + B)\cos x + (2B - 2A - 2B + A)\sin x]

=ex[(B)cosx+(A)sinx]= e^{-x}[(-B)\cos x + (-A)\sin x].

Setting equal to 3exsinx3e^{-x}\sin x: B=0-B = 0 and A=3-A = 3So A=3A = -3, B=0B = 0.

y=c1ex+c2xex3exsinxy = c_1 e^{-x} + c_2 xe^{-x} - 3e^{-x}\sin x. \blacksquare

3.9 Resonance

Consider the forced harmonic oscillator

y+ω02y=F0cos(ωt)y'' + \omega_0^2 y = F_0 \cos(\omega t)

Case 1: ωω0\omega \neq \omega_0 (Non-resonant). The particular solution is yp=F0ω02ω2cos(ωt)y_p = \frac{F_0}{\omega_0^2 - \omega^2}\cos(\omega t)With bounded amplitude.

Case 2: ω=ω0\omega = \omega_0 (Resonant). Since cos(ω0t)\cos(\omega_0 t) is a homogeneous solution, Guess yp=Atsin(ω0t)y_p = At\sin(\omega_0 t). Substituting:

yp+ω02yp=2Aω0cos(ω0t)Aω02tsin(ω0t)+Aω02tsin(ω0t)=2Aω0cos(ω0t)y_p'' + \omega_0^2 y_p = 2A\omega_0 \cos(\omega_0 t) - A\omega_0^2 t\sin(\omega_0 t) + A\omega_0^2 t\sin(\omega_0 t) = 2A\omega_0 \cos(\omega_0 t)

Setting equal to F0cos(ω0t)F_0 \cos(\omega_0 t): A=F02ω0A = \frac{F_0}{2\omega_0}.

yp=F02ω0tsin(ω0t)y_p = \frac{F_0}{2\omega_0} t \sin(\omega_0 t)

The amplitude grows linearly with tt --- this is resonance. Physically, the system absorbs energy From the periodic forcing at its natural frequency, causing unbounded oscillations.

Worked Example. Solve y+9y=6cos(3t)y'' + 9y = 6\cos(3t), y(0)=0y(0) = 0, y(0)=0y'(0) = 0.

Solution

Solution. ω0=3\omega_0 = 3, ω=3\omega = 3So this is the resonant case.

Homogeneous: r2+9=0r^2 + 9 = 0, r=±3ir = \pm 3i. yh=c1cos(3t)+c2sin(3t)y_h = c_1 \cos(3t) + c_2 \sin(3t).

yp=623tsin(3t)=tsin(3t)y_p = \frac{6}{2 \cdot 3} t\sin(3t) = t\sin(3t).

y=c1cos(3t)+c2sin(3t)+tsin(3t)y = c_1 \cos(3t) + c_2 \sin(3t) + t\sin(3t).

y(0)=c1=0y(0) = c_1 = 0.

y=3c2cos(3t)+sin(3t)+3tcos(3t)y' = 3c_2 \cos(3t) + \sin(3t) + 3t\cos(3t).

y(0)=3c2=0    c2=0y'(0) = 3c_2 = 0 \implies c_2 = 0.

y=tsin(3t)y = t\sin(3t). \blacksquare

3.10 Variation of Parameters

Theorem 3.4 (Variation of Parameters). For y+p(x)y+q(x)y=g(x)y'' + p(x)y' + q(x)y = g(x)Let y1,y2y_1, y_2 be a Fundamental set of solutions of the homogeneous equation. Then a particular solution is

yp=y1y2gWdx+y2y1gWdxy_p = -y_1 \int \frac{y_2 g}{W}\, dx + y_2 \int \frac{y_1 g}{W}\, dx

Where W=W(y1,y2)=y1y2y2y1W = W(y_1, y_2) = y_1 y_2' - y_2 y_1'.

Proof. Seek yp=u1(x)y1(x)+u2(x)y2(x)y_p = u_1(x)y_1(x) + u_2(x)y_2(x). Impose the constraint u1y1+u2y2=0u_1'y_1 + u_2'y_2 = 0. Then yp=u1y1+u2y2y_p' = u_1 y_1' + u_2 y_2' and yp=u1y1+u1y1+u2y2+u2y2y_p'' = u_1' y_1' + u_1 y_1'' + u_2' y_2' + u_2 y_2''. Substituting into the ODE: (u1y1+u2y2)+u1(y1+py1+qy1)+u2(y2+py2+qy2)=g(u_1'y_1' + u_2'y_2') + u_1(y_1'' + py_1' + qy_1) + u_2(y_2'' + py_2' + qy_2) = g. Since y1,y2y_1, y_2 satisfy the homogeneous equation, this reduces to u1y1+u2y2=gu_1'y_1' + u_2'y_2' = g. Together With u1y1+u2y2=0u_1'y_1 + u_2'y_2 = 0Solving gives the formulas above. \blacksquare

3.11 Worked Example: Variation of Parameters

Problem. Solve y+y=tanxy'' + y = \tan x using variation of parameters.

Solution. y1=cosxy_1 = \cos x, y2=sinxy_2 = \sin x. W=cosxcosxsinx(sinx)=1W = \cos x \cdot \cos x - \sin x \cdot (-\sin x) = 1.

u1=y2gW=sinxtanx=sin2xcosx=(1cos2x)/cosx=secx+cosxu_1' = -\frac{y_2 g}{W} = -\sin x \tan x = -\frac{\sin^2 x}{\cos x} = -(1 - \cos^2 x)/\cos x = -\sec x + \cos x.

u1=lnsecx+tanx+sinxu_1 = -\ln|\sec x + \tan x| + \sin x.

u2=y1gW=cosxtanx=sinxu_2' = \frac{y_1 g}{W} = \cos x \tan x = \sin x.

u2=cosxu_2 = -\cos x.

yp=(lnsecx+tanx+sinx)cosx+(cosx)sinx=cosxlnsecx+tanxy_p = (-\ln|\sec x + \tan x| + \sin x)\cos x + (-\cos x)\sin x = -\cos x \ln|\sec x + \tan x|.

y=c1cosx+c2sinxcosxlnsecx+tanxy = c_1 \cos x + c_2 \sin x - \cos x \ln|\sec x + \tan x|. \blacksquare

3.12 Reduction of Order

Theorem 3.5. Given one solution y1(x)y_1(x) of y+p(x)y+q(x)y=0y'' + p(x)y' + q(x)y = 0A second linearly Independent solution is obtained by setting y2=y1ep(x)dxy12dxy_2 = y_1 \int \frac{e^{-\int p(x)\, dx}}{y_1^2}\, dx.

Proof. Seek y2=v(x)y1(x)y_2 = v(x) y_1(x). Then y2=vy1+vy1y_2' = v'y_1 + vy_1' and y2=vy1+2vy1+vy1y_2'' = v''y_1 + 2v'y_1' + vy_1''. Substituting into the ODE:

vy1+2vy1+vy1+p(vy1+vy1)+qvy1=0v''y_1 + 2v'y_1' + vy_1'' + p(v'y_1 + vy_1') + qvy_1 = 0

vy1+v(2y1+py1)+v(y1+py1+qy1)=0v''y_1 + v'(2y_1' + py_1) + v(y_1'' + py_1' + qy_1) = 0

Since y1y_1 satisfies the ODE, the coefficient of vv vanishes:

vy1+v(2y1+py1)=0v''y_1 + v'(2y_1' + py_1) = 0

Let w=vw = v'. Then wy1+w(2y1+py1)=0w'y_1 + w(2y_1' + py_1) = 0A separable first-order ODE:

ww=2y1+py1y1=2y1y1p\frac{w'}{w} = -\frac{2y_1' + py_1}{y_1} = -2\frac{y_1'}{y_1} - p

lnw=2lny1pdx    w=epdxy12\ln w = -2\ln y_1 - \int p\, dx \implies w = \frac{e^{-\int p\, dx}}{y_1^2}

Since w=vw = v'We obtain the result. \blacksquare

Worked Example. Given that y1=exy_1 = e^x solves y2y+y=0y'' - 2y' + y = 0Find a second solution.

Solution

Solution. Here p(x)=2p(x) = -2So epdx=e2xe^{-\int p\, dx} = e^{2x}.

y2=exe2xe2xdx=ex1dx=xexy_2 = e^x \int \frac{e^{2x}}{e^{2x}}\, dx = e^x \int 1\, dx = xe^x.

This gives yh=c1ex+c2xexy_h = c_1 e^x + c_2 xe^xConsistent with the repeated-root case (r=1r = 1 with Multiplicity 2). \blacksquare

3.13 Euler-Cauchy Equations

An Euler-Cauchy (equidimensional) equation has the form

x2y+axy+by=0,x>0x^2 y'' + axy' + by = 0, \quad x > 0

The substitution y=xry = x^r gives the characteristic equation

r(r1)+ar+b=r2+(a1)r+b=0r(r - 1) + ar + b = r^2 + (a - 1)r + b = 0

Case 1: Two distinct real roots r1r2r_1 \neq r_2. yh=c1xr1+c2xr2y_h = c_1 x^{r_1} + c_2 x^{r_2}.

Case 2: Repeated root rr. yh=c1xr+c2xrlnxy_h = c_1 x^r + c_2 x^r \ln x.

Case 3: Complex roots r=α±iβr = \alpha \pm i\beta. yh=xα(c1cos(βlnx)+c2sin(βlnx))y_h = x^{\alpha}(c_1 \cos(\beta \ln x) + c_2 \sin(\beta \ln x)).

3.14 Worked Example: Euler-Cauchy Equation

Problem. Solve x2y3xy+4y=0x^2 y'' - 3xy' + 4y = 0.

Solution

Solution. Try y=xry = x^r: r(r1)3r+4=r24r+4=(r2)2=0r(r-1) - 3r + 4 = r^2 - 4r + 4 = (r-2)^2 = 0.

Repeated root r=2r = 2.

y=c1x2+c2x2lnxy = c_1 x^2 + c_2 x^2 \ln x. \blacksquare

Worked Example. Solve x2y+xy+y=0x^2 y'' + xy' + y = 0.

Solution

Solution. r(r1)+r+1=r2+1=0r(r-1) + r + 1 = r^2 + 1 = 0. Roots r=±ir = \pm i.

Here α=0\alpha = 0, β=1\beta = 1.

y=c1cos(lnx)+c2sin(lnx)y = c_1 \cos(\ln x) + c_2 \sin(\ln x). \blacksquare

3.15 Higher-Order Linear ODEs

For y(n)+an1y(n1)++a1y+a0y=0y^{(n)} + a_{n-1}y^{(n-1)} + \cdots + a_1 y' + a_0 y = 0:

  • Characteristic equation rn+an1rn1++a0=0r^n + a_{n-1}r^{n-1} + \cdots + a_0 = 0.
  • For root rr of multiplicity mm: include erx,xerx,,xm1erxe^{rx}, xe^{rx}, \ldots, x^{m-1}e^{rx}.
  • For complex roots α±iβ\alpha \pm i\beta of multiplicity mm: include eαxxkcos(βx)e^{\alpha x} x^k \cos(\beta x) and eαxxksin(βx)e^{\alpha x} x^k \sin(\beta x) for k=0,,m1k = 0, \ldots, m - 1.

3.16 Spring-Mass-Damper Systems

A mass mm on a spring with spring constant kk and damping coefficient ccSubject to external force F(t)F(t)Satisfies

mx+cx+kx=F(t)mx'' + cx' + kx = F(t)

Dividing by mm and setting ω0=k/m\omega_0 = \sqrt{k/m}, γ=c/(2m)\gamma = c/(2m):

x+2γx+ω02x=F(t)mx'' + 2\gamma x' + \omega_0^2 x = \frac{F(t)}{m}

The homogeneous solution depends on the discriminant γ2ω02\gamma^2 - \omega_0^2:

ConditionTypeHomogeneous Solution
γ2<ω02\gamma^2 \lt \omega_0^2Underdampedeγt(c1cos(ωdt)+c2sin(ωdt))e^{-\gamma t}(c_1 \cos(\omega_d t) + c_2 \sin(\omega_d t)), ωd=ω02γ2\omega_d = \sqrt{\omega_0^2 - \gamma^2}
γ2=ω02\gamma^2 = \omega_0^2Criticaleγt(c1+c2t)e^{-\gamma t}(c_1 + c_2 t)
γ2>ω02\gamma^2 > \omega_0^2Overdampedc1er1t+c2er2tc_1 e^{r_1 t} + c_2 e^{r_2 t}, r1,2=γ±γ2ω02r_{1,2} = -\gamma \pm \sqrt{\gamma^2 - \omega_0^2}

Damped Harmonic Oscillator

The underdamped oscillation eγtcos(ωdt)e^{-\gamma t}\cos(\omega_d t) (blue) decays inside the envelope ±eγt\pm e^{-\gamma t} (green/red). Adjust sliders c (damping γ\gamma) and w (damped frequency ωd\omega_d) to explore different regimes.

3.17 Common Pitfalls for Second-Order ODEs

:::caution Common Pitfall When using undetermined coefficients, always check whether your guess Overlaps with the homogeneous solution. For y4y=e2xy'' - 4y = e^{2x}Guessing yp=Ae2xy_p = Ae^{2x} fails Because e2xe^{2x} satisfies the homogeneous equation. You must use yp=Axe2xy_p = Axe^{2x} instead. :::

:::caution Common Pitfall For Euler-Cauchy equations, the substitution y=xry = x^r only works for x>0x > 0. For x<0x < 0Substitute x=etx = -e^t or use y=(x)ry = (-x)^r. :::

:::caution Common Pitfall Variation of parameters always works but can lead to difficult integrals. If the forcing term g(x)g(x) is a polynomial, exponential, sine, or cosine (or products of these), Prefer undetermined coefficients --- it is much faster.

3.18 Abel’s Identity (Proof)

Theorem 3.6 (Abel’s Identity). If y1,y2y_1, y_2 are solutions of y+p(x)y+q(x)y=0y'' + p(x)y' + q(x)y = 0 Then their Wronskian satisfies

W(x)=W(x0)ex0xp(t)dtW(x) = W(x_0) e^{-\int_{x_0}^x p(t)\, dt}

Proof. Since y1,y2y_1, y_2 satisfy the ODE:

y1=py1qy1y_1'' = -py_1' - qy_1 and y2=py2qy2y_2'' = -py_2' - qy_2.

W=y1y2+y1y2y1y2y1y2W' = y_1 y_2'' + y_1' y_2' - y_1'' y_2 - y_1' y_2'

=y1(py2qy2)(py1qy1)y2= y_1(-py_2' - qy_2) - (-py_1' - qy_1)y_2

=p(y1y2y1y2)=pW= -p(y_1 y_2' - y_1' y_2) = -pW.

So W+pW=0W' + pW = 0Giving W=CepdxW = Ce^{-\int p\, dx}And evaluating at x0x_0 gives the result. \blacksquare

Corollary. W(x)W(x) is either identically zero or never zero.

3.19 Worked Example: Variation of Parameters (Second Example)

Problem. Solve y4y=xexy'' - 4y = xe^x using variation of parameters.

Solution

Solution. Homogeneous: r24=0r^2 - 4 = 0, r=±2r = \pm 2. y1=e2xy_1 = e^{2x}, y2=e2xy_2 = e^{-2x}.

W=e2x(2e2x)e2x(2e2x)=4W = e^{2x}(-2e^{-2x}) - e^{-2x}(2e^{2x}) = -4.

u1=y2gW=e2xxex4=xex4u_1' = -\frac{y_2 g}{W} = -\frac{e^{-2x} \cdot xe^x}{-4} = \frac{xe^{-x}}{4}.

u1=14xexdx=14(xexex)+C1=(x+1)ex4u_1 = \frac{1}{4}\int xe^{-x}\, dx = \frac{1}{4}(-xe^{-x} - e^{-x}) + C_1 = -\frac{(x+1)e^{-x}}{4}.

u2=y1gW=e2xxex4=xe3x4u_2' = \frac{y_1 g}{W} = \frac{e^{2x} \cdot xe^x}{-4} = -\frac{xe^{3x}}{4}.

u2=14xe3xdx=14(xe3x3e3x9)+C2=(3x1)e3x36u_2 = -\frac{1}{4}\int xe^{3x}\, dx = -\frac{1}{4}\left(\frac{xe^{3x}}{3} - \frac{e^{3x}}{9}\right) + C_2 = -\frac{(3x - 1)e^{3x}}{36}.

yp=u1y1+u2y2=(x+1)ex4e2x+((3x1)e3x36)e2xy_p = u_1 y_1 + u_2 y_2 = -\frac{(x+1)e^{-x}}{4} \cdot e^{2x} + \left(-\frac{(3x-1)e^{3x}}{36}\right) \cdot e^{-2x}

=(x+1)ex4(3x1)ex36=ex(9(x+1)363x136)=ex(9x93x+136)=(x+2)ex9= -\frac{(x+1)e^x}{4} - \frac{(3x-1)e^x}{36} = e^x\left(-\frac{9(x+1)}{36} - \frac{3x - 1}{36}\right) = e^x\left(\frac{-9x - 9 - 3x + 1}{36}\right) = -\frac{(x + 2)e^x}{9}.

y=c1e2x+c2e2x(x+2)ex9y = c_1 e^{2x} + c_2 e^{-2x} - \frac{(x+2)e^x}{9}. \blacksquare

:::