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) y ′′ + p ( x ) y ′ + q ( x ) y = g ( x )
Theorem 3.1. If y 1 y_1 y 1 and y 2 y_2 y 2 are solutions of the homogeneous equation y ′ ′ + p y ′ + q y = 0 y'' + py' + qy = 0 y ′′ + p y ′ + q y = 0 Then c 1 y 1 + c 2 y 2 c_1 y_1 + c_2 y_2 c 1 y 1 + c 2 y 2 is also a solution (superposition principle).
Theorem 3.2 (Wronskian Criterion). Two solutions y 1 , y 2 y_1, y_2 y 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 ( y 1 , y 2 ) ( x ) = ∣ y 1 y 2 y 1 ′ y 2 ′ ∣ ≠ 0 W(y_1, y_2)(x) = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix} \neq 0 W ( y 1 , y 2 ) ( x ) = y 1 y 1 ′ y 2 y 2 ′ = 0
Abel’s identity states that W ( x ) = W ( x 0 ) e − ∫ x 0 x p ( t ) d t W(x) = W(x_0) e^{-\int_{x_0}^x p(t)\, dt} W ( x ) = W ( x 0 ) e − ∫ x 0 x p ( t ) d t .
Theorem 3.3. The general solution of y ′ ′ + p y ′ + q y = g y'' + py' + qy = g y ′′ + p y ′ + q y = g is y = y h + y p y = y_h + y_p y = y h + y p Where y h y_h y h is the General solution of the homogeneous equation and y p y_p y p is any particular solution.
For y ′ ′ + a y ′ + b y = 0 y'' + ay' + by = 0 y ′′ + a y ′ + b y = 0 with a , b a, b a , b constants, try y = e r x y = e^{rx} y = e r x :
r 2 + a r + b = 0 r^2 + ar + b = 0 r 2 + a r + b = 0
Case 1: Two distinct real roots r 1 ≠ r 2 r_1 \neq r_2 r 1 = r 2 . y h = c 1 e r 1 x + c 2 e r 2 x y_h = c_1 e^{r_1 x} + c_2 e^{r_2 x} y h = c 1 e r 1 x + c 2 e r 2 x .
Case 2: Repeated root r r r . y h = c 1 e r x + c 2 x e r x y_h = c_1 e^{rx} + c_2 x e^{rx} y h = c 1 e r x + c 2 x e r x .
Case 3: Complex conjugate roots r = α ± i β r = \alpha \pm i\beta r = α ± i β . y h = e α x ( c 1 cos ( β x ) + c 2 sin ( β x ) ) y_h = e^{\alpha x}(c_1 \cos(\beta x) + c_2 \sin(\beta x)) y h = e α x ( c 1 cos ( β x ) + c 2 sin ( β x )) .
Problem. Solve y ′ ′ − 5 y ′ + 6 y = 0 y'' - 5y' + 6y = 0 y ′′ − 5 y ′ + 6 y = 0 with y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 , y ′ ( 0 ) = 0 y'(0) = 0 y ′ ( 0 ) = 0 .
Solution. Characteristic equation: r 2 − 5 r + 6 = ( r − 2 ) ( r − 3 ) = 0 r^2 - 5r + 6 = (r-2)(r-3) = 0 r 2 − 5 r + 6 = ( r − 2 ) ( r − 3 ) = 0 . Roots: r = 2 , 3 r = 2, 3 r = 2 , 3 .
y h = c 1 e 2 x + c 2 e 3 x y_h = c_1 e^{2x} + c_2 e^{3x} y h = c 1 e 2 x + c 2 e 3 x .
y ( 0 ) = c 1 + c 2 = 1 y(0) = c_1 + c_2 = 1 y ( 0 ) = c 1 + c 2 = 1 . y ′ ( 0 ) = 2 c 1 + 3 c 2 = 0 y'(0) = 2c_1 + 3c_2 = 0 y ′ ( 0 ) = 2 c 1 + 3 c 2 = 0 . Solving: c 1 = 3 c_1 = 3 c 1 = 3 , c 2 = − 2 c_2 = -2 c 2 = − 2 .
y = 3 e 2 x − 2 e 3 x y = 3e^{2x} - 2e^{3x} y = 3 e 2 x − 2 e 3 x . ■ \blacksquare ■
Problem. Solve y ′ ′ + 2 y ′ + 5 y = 0 y'' + 2y' + 5y = 0 y ′′ + 2 y ′ + 5 y = 0 with y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 , y ′ ( 0 ) = 0 y'(0) = 0 y ′ ( 0 ) = 0 .
Solution Solution. Characteristic equation: r 2 + 2 r + 5 = 0 r^2 + 2r + 5 = 0 r 2 + 2 r + 5 = 0 .
r = − 2 ± 4 − 20 2 = − 2 ± − 16 2 = − 1 ± 2 i r = \frac{-2 \pm \sqrt{4 - 20}}{2} = \frac{-2 \pm \sqrt{-16}}{2} = -1 \pm 2i r = 2 − 2 ± 4 − 20 = 2 − 2 ± − 16 = − 1 ± 2 i .
So α = − 1 \alpha = -1 α = − 1 , β = 2 \beta = 2 β = 2 .
y = e − x ( c 1 cos ( 2 x ) + c 2 sin ( 2 x ) ) y = e^{-x}(c_1 \cos(2x) + c_2 \sin(2x)) y = e − x ( c 1 cos ( 2 x ) + c 2 sin ( 2 x )) .
y ( 0 ) = c 1 = 1 y(0) = c_1 = 1 y ( 0 ) = c 1 = 1 .
y ′ = − e − x ( cos ( 2 x ) + c 2 sin ( 2 x ) ) + e − x ( − 2 sin ( 2 x ) + 2 c 2 cos ( 2 x ) ) y' = -e^{-x}(\cos(2x) + c_2 \sin(2x)) + e^{-x}(-2\sin(2x) + 2c_2 \cos(2x)) y ′ = − e − x ( cos ( 2 x ) + c 2 sin ( 2 x )) + e − x ( − 2 sin ( 2 x ) + 2 c 2 cos ( 2 x )) .
y ′ ( 0 ) = − 1 + 2 c 2 = 0 ⟹ c 2 = 1 / 2 y'(0) = -1 + 2c_2 = 0 \implies c_2 = 1/2 y ′ ( 0 ) = − 1 + 2 c 2 = 0 ⟹ c 2 = 1/2 .
y = e − x ( cos ( 2 x ) + 1 2 sin ( 2 x ) ) y = e^{-x}\left(\cos(2x) + \frac{1}{2}\sin(2x)\right) y = e − x ( cos ( 2 x ) + 2 1 sin ( 2 x ) ) . ■ \blacksquare ■
Problem. Solve y ′ ′ − 4 y ′ + 4 y = 0 y'' - 4y' + 4y = 0 y ′′ − 4 y ′ + 4 y = 0 with y ( 0 ) = 1 y(0) = 1 y ( 0 ) = 1 , y ′ ( 0 ) = 3 y'(0) = 3 y ′ ( 0 ) = 3 .
Solution Solution. Characteristic equation: r 2 − 4 r + 4 = ( r − 2 ) 2 = 0 r^2 - 4r + 4 = (r - 2)^2 = 0 r 2 − 4 r + 4 = ( r − 2 ) 2 = 0 . Repeated root r = 2 r = 2 r = 2 .
y = c 1 e 2 x + c 2 x e 2 x y = c_1 e^{2x} + c_2 xe^{2x} y = c 1 e 2 x + c 2 x e 2 x .
y ( 0 ) = c 1 = 1 y(0) = c_1 = 1 y ( 0 ) = c 1 = 1 .
y ′ = 2 c 1 e 2 x + c 2 e 2 x + 2 c 2 x e 2 x y' = 2c_1 e^{2x} + c_2 e^{2x} + 2c_2 xe^{2x} y ′ = 2 c 1 e 2 x + c 2 e 2 x + 2 c 2 x e 2 x .
y ′ ( 0 ) = 2 c 1 + c 2 = 3 ⟹ 2 + c 2 = 3 ⟹ c 2 = 1 y'(0) = 2c_1 + c_2 = 3 \implies 2 + c_2 = 3 \implies c_2 = 1 y ′ ( 0 ) = 2 c 1 + c 2 = 3 ⟹ 2 + c 2 = 3 ⟹ c 2 = 1 .
y = e 2 x + x e 2 x = e 2 x ( 1 + x ) y = e^{2x} + xe^{2x} = e^{2x}(1 + x) y = e 2 x + x e 2 x = e 2 x ( 1 + x ) . ■ \blacksquare ■
For equations y ′ ′ + a y ′ + b y = g ( x ) y'' + ay' + by = g(x) y ′′ + a y ′ + b y = g ( x ) where g ( x ) g(x) g ( x ) is a polynomial, exponential, sine, cosine, or Products of these, guess the form of y p y_p y p and solve for coefficients.
g ( x ) g(x) g ( x ) Guess for y p y_p y p P n ( x ) P_n(x) P n ( x ) A n x n + ⋯ + A 0 A_n x^n + \cdots + A_0 A n x n + ⋯ + A 0 e a x e^{ax} e a x A e a x Ae^{ax} A e a x sin ( b x ) \sin(bx) sin ( b x ) or cos ( b x ) \cos(bx) cos ( b x ) A sin ( b x ) + B cos ( b x ) A\sin(bx) + B\cos(bx) A sin ( b x ) + B cos ( b x ) e a x P n ( x ) e^{ax} P_n(x) e a x P n ( x ) e a x ( A n x n + ⋯ + A 0 ) e^{ax}(A_n x^n + \cdots + A_0) e a x ( A n x n + ⋯ + A 0 ) e a x sin ( b x ) e^{ax}\sin(bx) e a x sin ( b x ) or e a x cos ( b x ) e^{ax}\cos(bx) e a x cos ( b x ) e a x ( A sin ( b x ) + B cos ( b x ) ) e^{ax}(A\sin(bx) + B\cos(bx)) e a x ( A sin ( b x ) + B cos ( b x ))
Rule. If any term of the guess is a solution of the homogeneous equation, multiply by x x x (or x 2 x^2 x 2 if already multiplied by x x x ).
Problem. Solve y ′ ′ − y = 2 e x y'' - y = 2e^x y ′′ − y = 2 e x .
Solution. Homogeneous: r 2 − 1 = 0 r^2 - 1 = 0 r 2 − 1 = 0 Roots ± 1 \pm 1 ± 1 . y h = c 1 e x + c 2 e − x y_h = c_1 e^x + c_2 e^{-x} y h = c 1 e x + c 2 e − x .
Since e x e^x e x is a homogeneous solution, guess y p = A x e x y_p = Axe^x y p = A x e x . y p ′ = A e x + A x e x y_p' = Ae^x + Axe^x y p ′ = A e x + A x e x y p ′ ′ = 2 A e x + A x e x y_p'' = 2Ae^x + Axe^x y p ′′ = 2 A e x + A x e x . y p ′ ′ − y p = ( 2 A e x + A x e x ) − A x e x = 2 A e x = 2 e x y_p'' - y_p = (2Ae^x + Axe^x) - Axe^x = 2Ae^x = 2e^x y p ′′ − y p = ( 2 A e x + A x e x ) − A x e x = 2 A e x = 2 e x So A = 1 A = 1 A = 1 .
y = c 1 e x + c 2 e − x + x e x y = c_1 e^x + c_2 e^{-x} + xe^x y = c 1 e x + c 2 e − x + x e x . ■ \blacksquare ■
Problem. Solve y ′ ′ + 3 y ′ + 2 y = x 2 + 1 y'' + 3y' + 2y = x^2 + 1 y ′′ + 3 y ′ + 2 y = x 2 + 1 .
Solution Solution. Homogeneous: r 2 + 3 r + 2 = ( r + 1 ) ( r + 2 ) = 0 r^2 + 3r + 2 = (r+1)(r+2) = 0 r 2 + 3 r + 2 = ( r + 1 ) ( r + 2 ) = 0 Roots − 1 , − 2 -1, -2 − 1 , − 2 .
y h = c 1 e − x + c 2 e − 2 x y_h = c_1 e^{-x} + c_2 e^{-2x} y h = c 1 e − x + c 2 e − 2 x .
Guess y p = A x 2 + B x + C y_p = Ax^2 + Bx + C y p = A x 2 + B x + C . Then y p ′ = 2 A x + B y_p' = 2Ax + B y p ′ = 2 A x + B , y p ′ ′ = 2 A y_p'' = 2A y p ′′ = 2 A .
Substituting: 2 A + 3 ( 2 A x + B ) + 2 ( A x 2 + B x + C ) = x 2 + 1 2A + 3(2Ax + B) + 2(Ax^2 + Bx + C) = x^2 + 1 2 A + 3 ( 2 A x + B ) + 2 ( A x 2 + B x + C ) = x 2 + 1 .
2 A + 6 A x + 3 B + 2 A x 2 + 2 B x + 2 C = x 2 + 1 2A + 6Ax + 3B + 2Ax^2 + 2Bx + 2C = x^2 + 1 2 A + 6 A x + 3 B + 2 A x 2 + 2 B x + 2 C = x 2 + 1 .
Matching coefficients:
x 2 x^2 x 2 : 2 A = 1 ⟹ A = 1 / 2 2A = 1 \implies A = 1/2 2 A = 1 ⟹ A = 1/2 x x x : 6 A + 2 B = 0 ⟹ 3 + 2 B = 0 ⟹ B = − 3 / 2 6A + 2B = 0 \implies 3 + 2B = 0 \implies B = -3/2 6 A + 2 B = 0 ⟹ 3 + 2 B = 0 ⟹ B = − 3/2 Constant: 2 A + 3 B + 2 C = 1 ⟹ 1 − 9 / 2 + 2 C = 1 ⟹ 2 C = 9 / 2 ⟹ C = 9 / 4 2A + 3B + 2C = 1 \implies 1 - 9/2 + 2C = 1 \implies 2C = 9/2 \implies C = 9/4 2 A + 3 B + 2 C = 1 ⟹ 1 − 9/2 + 2 C = 1 ⟹ 2 C = 9/2 ⟹ C = 9/4 y p = x 2 2 − 3 x 2 + 9 4 y_p = \frac{x^2}{2} - \frac{3x}{2} + \frac{9}{4} y p = 2 x 2 − 2 3 x + 4 9 .
y = c 1 e − x + c 2 e − 2 x + x 2 2 − 3 x 2 + 9 4 y = c_1 e^{-x} + c_2 e^{-2x} + \frac{x^2}{2} - \frac{3x}{2} + \frac{9}{4} y = c 1 e − x + c 2 e − 2 x + 2 x 2 − 2 3 x + 4 9 . ■ \blacksquare ■
Problem. Solve y ′ ′ + 2 y ′ + y = 3 e − x sin x y'' + 2y' + y = 3e^{-x}\sin x y ′′ + 2 y ′ + y = 3 e − x sin x .
Solution Solution. Homogeneous: r 2 + 2 r + 1 = ( r + 1 ) 2 = 0 r^2 + 2r + 1 = (r+1)^2 = 0 r 2 + 2 r + 1 = ( r + 1 ) 2 = 0 . Repeated root r = − 1 r = -1 r = − 1 .
y h = c 1 e − x + c 2 x e − x y_h = c_1 e^{-x} + c_2 xe^{-x} y h = c 1 e − x + c 2 x e − x .
The forcing is e − x sin x e^{-x}\sin x e − x sin x So guess y p = e − x ( A sin x + B cos x ) y_p = e^{-x}(A\sin x + B\cos x) y p = e − x ( A sin x + B cos x ) .
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 ) 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) 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 ) .
y p ′ ′ = − e − x ( ( A − B ) cos x − ( A + B ) sin x ) + e − x ( − ( A − B ) sin x − ( A + B ) cos x ) y_p'' = -e^{-x}((A - B)\cos x - (A + B)\sin x) + e^{-x}(-(A - B)\sin x - (A + B)\cos x) y p ′′ = − e − x (( A − B ) cos x − ( A + B ) sin x ) + e − x ( − ( A − B ) sin x − ( A + B ) cos x )
= e − x ( − 2 A cos x + 2 B sin x ) = e^{-x}(-2A\cos x + 2B\sin x) = e − x ( − 2 A cos x + 2 B sin x ) .
y p ′ ′ + 2 y p ′ + y p = e − x ( − 2 A cos x + 2 B sin x ) + 2 e − x ( ( A − B ) cos x − ( A + B ) sin x ) + e − x ( A sin x + B cos x ) 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) y p ′′ + 2 y p ′ + y p = e − x ( − 2 A cos x + 2 B sin x ) + 2 e − x (( A − B ) cos x − ( A + B ) sin x ) + e − x ( A sin x + B cos x )
= e − x [ ( − 2 A + 2 A − 2 B + B ) cos x + ( 2 B − 2 A − 2 B + A ) sin x ] = e^{-x}[(-2A + 2A - 2B + B)\cos x + (2B - 2A - 2B + A)\sin x] = e − x [( − 2 A + 2 A − 2 B + B ) cos x + ( 2 B − 2 A − 2 B + A ) sin x ]
= e − x [ ( − B ) cos x + ( − A ) sin x ] = e^{-x}[(-B)\cos x + (-A)\sin x] = e − x [( − B ) cos x + ( − A ) sin x ] .
Setting equal to 3 e − x sin x 3e^{-x}\sin x 3 e − x sin x : − B = 0 -B = 0 − B = 0 and − A = 3 -A = 3 − A = 3 So A = − 3 A = -3 A = − 3 , B = 0 B = 0 B = 0 .
y = c 1 e − x + c 2 x e − x − 3 e − x sin x y = c_1 e^{-x} + c_2 xe^{-x} - 3e^{-x}\sin x y = c 1 e − x + c 2 x e − x − 3 e − x sin x . ■ \blacksquare ■
Consider the forced harmonic oscillator
y ′ ′ + ω 0 2 y = F 0 cos ( ω t ) y'' + \omega_0^2 y = F_0 \cos(\omega t) y ′′ + ω 0 2 y = F 0 cos ( ω t )
Case 1: ω ≠ ω 0 \omega \neq \omega_0 ω = ω 0 (Non-resonant). The particular solution is y p = F 0 ω 0 2 − ω 2 cos ( ω t ) y_p = \frac{F_0}{\omega_0^2 - \omega^2}\cos(\omega t) y p = ω 0 2 − ω 2 F 0 cos ( ω t ) With bounded amplitude.
Case 2: ω = ω 0 \omega = \omega_0 ω = ω 0 (Resonant). Since cos ( ω 0 t ) \cos(\omega_0 t) cos ( ω 0 t ) is a homogeneous solution, Guess y p = A t sin ( ω 0 t ) y_p = At\sin(\omega_0 t) y p = A t sin ( ω 0 t ) . Substituting:
y p ′ ′ + ω 0 2 y p = 2 A ω 0 cos ( ω 0 t ) − A ω 0 2 t sin ( ω 0 t ) + A ω 0 2 t sin ( ω 0 t ) = 2 A ω 0 cos ( ω 0 t ) 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) y p ′′ + ω 0 2 y p = 2 A ω 0 cos ( ω 0 t ) − A ω 0 2 t sin ( ω 0 t ) + A ω 0 2 t sin ( ω 0 t ) = 2 A ω 0 cos ( ω 0 t )
Setting equal to F 0 cos ( ω 0 t ) F_0 \cos(\omega_0 t) F 0 cos ( ω 0 t ) : A = F 0 2 ω 0 A = \frac{F_0}{2\omega_0} A = 2 ω 0 F 0 .
y p = F 0 2 ω 0 t sin ( ω 0 t ) y_p = \frac{F_0}{2\omega_0} t \sin(\omega_0 t) y p = 2 ω 0 F 0 t sin ( ω 0 t )
The amplitude grows linearly with t t t --- this is resonance . Physically, the system absorbs energy From the periodic forcing at its natural frequency, causing unbounded oscillations.
Worked Example. Solve y ′ ′ + 9 y = 6 cos ( 3 t ) y'' + 9y = 6\cos(3t) y ′′ + 9 y = 6 cos ( 3 t ) , y ( 0 ) = 0 y(0) = 0 y ( 0 ) = 0 , y ′ ( 0 ) = 0 y'(0) = 0 y ′ ( 0 ) = 0 .
Solution Solution. ω 0 = 3 \omega_0 = 3 ω 0 = 3 , ω = 3 \omega = 3 ω = 3 So this is the resonant case.
Homogeneous: r 2 + 9 = 0 r^2 + 9 = 0 r 2 + 9 = 0 , r = ± 3 i r = \pm 3i r = ± 3 i . y h = c 1 cos ( 3 t ) + c 2 sin ( 3 t ) y_h = c_1 \cos(3t) + c_2 \sin(3t) y h = c 1 cos ( 3 t ) + c 2 sin ( 3 t ) .
y p = 6 2 ⋅ 3 t sin ( 3 t ) = t sin ( 3 t ) y_p = \frac{6}{2 \cdot 3} t\sin(3t) = t\sin(3t) y p = 2 ⋅ 3 6 t sin ( 3 t ) = t sin ( 3 t ) .
y = c 1 cos ( 3 t ) + c 2 sin ( 3 t ) + t sin ( 3 t ) y = c_1 \cos(3t) + c_2 \sin(3t) + t\sin(3t) y = c 1 cos ( 3 t ) + c 2 sin ( 3 t ) + t sin ( 3 t ) .
y ( 0 ) = c 1 = 0 y(0) = c_1 = 0 y ( 0 ) = c 1 = 0 .
y ′ = 3 c 2 cos ( 3 t ) + sin ( 3 t ) + 3 t cos ( 3 t ) y' = 3c_2 \cos(3t) + \sin(3t) + 3t\cos(3t) y ′ = 3 c 2 cos ( 3 t ) + sin ( 3 t ) + 3 t cos ( 3 t ) .
y ′ ( 0 ) = 3 c 2 = 0 ⟹ c 2 = 0 y'(0) = 3c_2 = 0 \implies c_2 = 0 y ′ ( 0 ) = 3 c 2 = 0 ⟹ c 2 = 0 .
y = t sin ( 3 t ) y = t\sin(3t) y = t sin ( 3 t ) . ■ \blacksquare ■
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) y ′′ + p ( x ) y ′ + q ( x ) y = g ( x ) Let y 1 , y 2 y_1, y_2 y 1 , y 2 be a Fundamental set of solutions of the homogeneous equation. Then a particular solution is
y p = − y 1 ∫ y 2 g W d x + y 2 ∫ y 1 g W d x y_p = -y_1 \int \frac{y_2 g}{W}\, dx + y_2 \int \frac{y_1 g}{W}\, dx y p = − y 1 ∫ W y 2 g d x + y 2 ∫ W y 1 g d x
Where W = W ( y 1 , y 2 ) = y 1 y 2 ′ − y 2 y 1 ′ W = W(y_1, y_2) = y_1 y_2' - y_2 y_1' W = W ( y 1 , y 2 ) = y 1 y 2 ′ − y 2 y 1 ′ .
Proof. Seek y p = u 1 ( x ) y 1 ( x ) + u 2 ( x ) y 2 ( x ) y_p = u_1(x)y_1(x) + u_2(x)y_2(x) y p = u 1 ( x ) y 1 ( x ) + u 2 ( x ) y 2 ( x ) . Impose the constraint u 1 ′ y 1 + u 2 ′ y 2 = 0 u_1'y_1 + u_2'y_2 = 0 u 1 ′ y 1 + u 2 ′ y 2 = 0 . Then y p ′ = u 1 y 1 ′ + u 2 y 2 ′ y_p' = u_1 y_1' + u_2 y_2' y p ′ = u 1 y 1 ′ + u 2 y 2 ′ and y p ′ ′ = u 1 ′ y 1 ′ + u 1 y 1 ′ ′ + u 2 ′ y 2 ′ + u 2 y 2 ′ ′ y_p'' = u_1' y_1' + u_1 y_1'' + u_2' y_2' + u_2 y_2'' y p ′′ = u 1 ′ y 1 ′ + u 1 y 1 ′′ + u 2 ′ y 2 ′ + u 2 y 2 ′′ . Substituting into the ODE: ( u 1 ′ y 1 ′ + u 2 ′ y 2 ′ ) + u 1 ( y 1 ′ ′ + p y 1 ′ + q y 1 ) + u 2 ( y 2 ′ ′ + p y 2 ′ + q y 2 ) = 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 ( u 1 ′ y 1 ′ + u 2 ′ y 2 ′ ) + u 1 ( y 1 ′′ + p y 1 ′ + q y 1 ) + u 2 ( y 2 ′′ + p y 2 ′ + q y 2 ) = g . Since y 1 , y 2 y_1, y_2 y 1 , y 2 satisfy the homogeneous equation, this reduces to u 1 ′ y 1 ′ + u 2 ′ y 2 ′ = g u_1'y_1' + u_2'y_2' = g u 1 ′ y 1 ′ + u 2 ′ y 2 ′ = g . Together With u 1 ′ y 1 + u 2 ′ y 2 = 0 u_1'y_1 + u_2'y_2 = 0 u 1 ′ y 1 + u 2 ′ y 2 = 0 Solving gives the formulas above. ■ \blacksquare ■
Problem. Solve y ′ ′ + y = tan x y'' + y = \tan x y ′′ + y = tan x using variation of parameters.
Solution. y 1 = cos x y_1 = \cos x y 1 = cos x , y 2 = sin x y_2 = \sin x y 2 = sin x . W = cos x ⋅ cos x − sin x ⋅ ( − sin x ) = 1 W = \cos x \cdot \cos x - \sin x \cdot (-\sin x) = 1 W = cos x ⋅ cos x − sin x ⋅ ( − sin x ) = 1 .
u 1 ′ = − y 2 g W = − sin x tan x = − sin 2 x cos x = − ( 1 − cos 2 x ) / cos x = − sec x + cos x u_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 u 1 ′ = − W y 2 g = − sin x tan x = − c o s x s i n 2 x = − ( 1 − cos 2 x ) / cos x = − sec x + cos x .
u 1 = − ln ∣ sec x + tan x ∣ + sin x u_1 = -\ln|\sec x + \tan x| + \sin x u 1 = − ln ∣ sec x + tan x ∣ + sin x .
u 2 ′ = y 1 g W = cos x tan x = sin x u_2' = \frac{y_1 g}{W} = \cos x \tan x = \sin x u 2 ′ = W y 1 g = cos x tan x = sin x .
u 2 = − cos x u_2 = -\cos x u 2 = − cos x .
y p = ( − ln ∣ sec x + tan x ∣ + sin x ) cos x + ( − cos x ) sin x = − cos x ln ∣ sec x + tan x ∣ y_p = (-\ln|\sec x + \tan x| + \sin x)\cos x + (-\cos x)\sin x = -\cos x \ln|\sec x + \tan x| y p = ( − ln ∣ sec x + tan x ∣ + sin x ) cos x + ( − cos x ) sin x = − cos x ln ∣ sec x + tan x ∣ .
y = c 1 cos x + c 2 sin x − cos x ln ∣ sec x + tan x ∣ y = c_1 \cos x + c_2 \sin x - \cos x \ln|\sec x + \tan x| y = c 1 cos x + c 2 sin x − cos x ln ∣ sec x + tan x ∣ . ■ \blacksquare ■
Theorem 3.5. Given one solution y 1 ( x ) y_1(x) y 1 ( x ) of y ′ ′ + p ( x ) y ′ + q ( x ) y = 0 y'' + p(x)y' + q(x)y = 0 y ′′ + p ( x ) y ′ + q ( x ) y = 0 A second linearly Independent solution is obtained by setting y 2 = y 1 ∫ e − ∫ p ( x ) d x y 1 2 d x y_2 = y_1 \int \frac{e^{-\int p(x)\, dx}}{y_1^2}\, dx y 2 = y 1 ∫ y 1 2 e − ∫ p ( x ) d x d x .
Proof. Seek y 2 = v ( x ) y 1 ( x ) y_2 = v(x) y_1(x) y 2 = v ( x ) y 1 ( x ) . Then y 2 ′ = v ′ y 1 + v y 1 ′ y_2' = v'y_1 + vy_1' y 2 ′ = v ′ y 1 + v y 1 ′ and y 2 ′ ′ = v ′ ′ y 1 + 2 v ′ y 1 ′ + v y 1 ′ ′ y_2'' = v''y_1 + 2v'y_1' + vy_1'' y 2 ′′ = v ′′ y 1 + 2 v ′ y 1 ′ + v y 1 ′′ . Substituting into the ODE:
v ′ ′ y 1 + 2 v ′ y 1 ′ + v y 1 ′ ′ + p ( v ′ y 1 + v y 1 ′ ) + q v y 1 = 0 v''y_1 + 2v'y_1' + vy_1'' + p(v'y_1 + vy_1') + qvy_1 = 0 v ′′ y 1 + 2 v ′ y 1 ′ + v y 1 ′′ + p ( v ′ y 1 + v y 1 ′ ) + q v y 1 = 0
v ′ ′ y 1 + v ′ ( 2 y 1 ′ + p y 1 ) + v ( y 1 ′ ′ + p y 1 ′ + q y 1 ) = 0 v''y_1 + v'(2y_1' + py_1) + v(y_1'' + py_1' + qy_1) = 0 v ′′ y 1 + v ′ ( 2 y 1 ′ + p y 1 ) + v ( y 1 ′′ + p y 1 ′ + q y 1 ) = 0
Since y 1 y_1 y 1 satisfies the ODE, the coefficient of v v v vanishes:
v ′ ′ y 1 + v ′ ( 2 y 1 ′ + p y 1 ) = 0 v''y_1 + v'(2y_1' + py_1) = 0 v ′′ y 1 + v ′ ( 2 y 1 ′ + p y 1 ) = 0
Let w = v ′ w = v' w = v ′ . Then w ′ y 1 + w ( 2 y 1 ′ + p y 1 ) = 0 w'y_1 + w(2y_1' + py_1) = 0 w ′ y 1 + w ( 2 y 1 ′ + p y 1 ) = 0 A separable first-order ODE:
w ′ w = − 2 y 1 ′ + p y 1 y 1 = − 2 y 1 ′ y 1 − p \frac{w'}{w} = -\frac{2y_1' + py_1}{y_1} = -2\frac{y_1'}{y_1} - p w w ′ = − y 1 2 y 1 ′ + p y 1 = − 2 y 1 y 1 ′ − p
ln w = − 2 ln y 1 − ∫ p d x ⟹ w = e − ∫ p d x y 1 2 \ln w = -2\ln y_1 - \int p\, dx \implies w = \frac{e^{-\int p\, dx}}{y_1^2} ln w = − 2 ln y 1 − ∫ p d x ⟹ w = y 1 2 e − ∫ p d x
Since w = v ′ w = v' w = v ′ We obtain the result. ■ \blacksquare ■
Worked Example. Given that y 1 = e x y_1 = e^x y 1 = e x solves y ′ ′ − 2 y ′ + y = 0 y'' - 2y' + y = 0 y ′′ − 2 y ′ + y = 0 Find a second solution.
Solution Solution. Here p ( x ) = − 2 p(x) = -2 p ( x ) = − 2 So e − ∫ p d x = e 2 x e^{-\int p\, dx} = e^{2x} e − ∫ p d x = e 2 x .
y 2 = e x ∫ e 2 x e 2 x d x = e x ∫ 1 d x = x e x y_2 = e^x \int \frac{e^{2x}}{e^{2x}}\, dx = e^x \int 1\, dx = xe^x y 2 = e x ∫ e 2 x e 2 x d x = e x ∫ 1 d x = x e x .
This gives y h = c 1 e x + c 2 x e x y_h = c_1 e^x + c_2 xe^x y h = c 1 e x + c 2 x e x Consistent with the repeated-root case (r = 1 r = 1 r = 1 with Multiplicity 2). ■ \blacksquare ■
An Euler-Cauchy (equidimensional) equation has the form
x 2 y ′ ′ + a x y ′ + b y = 0 , x > 0 x^2 y'' + axy' + by = 0, \quad x > 0 x 2 y ′′ + a x y ′ + b y = 0 , x > 0
The substitution y = x r y = x^r y = x r gives the characteristic equation
r ( r − 1 ) + a r + b = r 2 + ( a − 1 ) r + b = 0 r(r - 1) + ar + b = r^2 + (a - 1)r + b = 0 r ( r − 1 ) + a r + b = r 2 + ( a − 1 ) r + b = 0
Case 1: Two distinct real roots r 1 ≠ r 2 r_1 \neq r_2 r 1 = r 2 . y h = c 1 x r 1 + c 2 x r 2 y_h = c_1 x^{r_1} + c_2 x^{r_2} y h = c 1 x r 1 + c 2 x r 2 .
Case 2: Repeated root r r r . y h = c 1 x r + c 2 x r ln x y_h = c_1 x^r + c_2 x^r \ln x y h = c 1 x r + c 2 x r ln x .
Case 3: Complex roots r = α ± i β r = \alpha \pm i\beta r = α ± i β . y h = x α ( c 1 cos ( β ln x ) + c 2 sin ( β ln x ) ) y_h = x^{\alpha}(c_1 \cos(\beta \ln x) + c_2 \sin(\beta \ln x)) y h = x α ( c 1 cos ( β ln x ) + c 2 sin ( β ln x )) .
Problem. Solve x 2 y ′ ′ − 3 x y ′ + 4 y = 0 x^2 y'' - 3xy' + 4y = 0 x 2 y ′′ − 3 x y ′ + 4 y = 0 .
Solution Solution. Try y = x r y = x^r y = x r : r ( r − 1 ) − 3 r + 4 = r 2 − 4 r + 4 = ( r − 2 ) 2 = 0 r(r-1) - 3r + 4 = r^2 - 4r + 4 = (r-2)^2 = 0 r ( r − 1 ) − 3 r + 4 = r 2 − 4 r + 4 = ( r − 2 ) 2 = 0 .
Repeated root r = 2 r = 2 r = 2 .
y = c 1 x 2 + c 2 x 2 ln x y = c_1 x^2 + c_2 x^2 \ln x y = c 1 x 2 + c 2 x 2 ln x . ■ \blacksquare ■
Worked Example. Solve x 2 y ′ ′ + x y ′ + y = 0 x^2 y'' + xy' + y = 0 x 2 y ′′ + x y ′ + y = 0 .
Solution Solution. r ( r − 1 ) + r + 1 = r 2 + 1 = 0 r(r-1) + r + 1 = r^2 + 1 = 0 r ( r − 1 ) + r + 1 = r 2 + 1 = 0 . Roots r = ± i r = \pm i r = ± i .
Here α = 0 \alpha = 0 α = 0 , β = 1 \beta = 1 β = 1 .
y = c 1 cos ( ln x ) + c 2 sin ( ln x ) y = c_1 \cos(\ln x) + c_2 \sin(\ln x) y = c 1 cos ( ln x ) + c 2 sin ( ln x ) . ■ \blacksquare ■
For y ( n ) + a n − 1 y ( n − 1 ) + ⋯ + a 1 y ′ + a 0 y = 0 y^{(n)} + a_{n-1}y^{(n-1)} + \cdots + a_1 y' + a_0 y = 0 y ( n ) + a n − 1 y ( n − 1 ) + ⋯ + a 1 y ′ + a 0 y = 0 :
Characteristic equation r n + a n − 1 r n − 1 + ⋯ + a 0 = 0 r^n + a_{n-1}r^{n-1} + \cdots + a_0 = 0 r n + a n − 1 r n − 1 + ⋯ + a 0 = 0 . For root r r r of multiplicity m m m : include e r x , x e r x , … , x m − 1 e r x e^{rx}, xe^{rx}, \ldots, x^{m-1}e^{rx} e r x , x e r x , … , x m − 1 e r x . For complex roots α ± i β \alpha \pm i\beta α ± i β of multiplicity m m m : include e α x x k cos ( β x ) e^{\alpha x} x^k \cos(\beta x) e α x x k cos ( β x ) and e α x x k sin ( β x ) e^{\alpha x} x^k \sin(\beta x) e α x x k sin ( β x ) for k = 0 , … , m − 1 k = 0, \ldots, m - 1 k = 0 , … , m − 1 . A mass m m m on a spring with spring constant k k k and damping coefficient c c c Subject to external force F ( t ) F(t) F ( t ) Satisfies
m x ′ ′ + c x ′ + k x = F ( t ) mx'' + cx' + kx = F(t) m x ′′ + c x ′ + k x = F ( t )
Dividing by m m m and setting ω 0 = k / m \omega_0 = \sqrt{k/m} ω 0 = k / m , γ = c / ( 2 m ) \gamma = c/(2m) γ = c / ( 2 m ) :
x ′ ′ + 2 γ x ′ + ω 0 2 x = F ( t ) m x'' + 2\gamma x' + \omega_0^2 x = \frac{F(t)}{m} x ′′ + 2 γ x ′ + ω 0 2 x = m F ( t )
The homogeneous solution depends on the discriminant γ 2 − ω 0 2 \gamma^2 - \omega_0^2 γ 2 − ω 0 2 :
Condition Type Homogeneous Solution γ 2 < ω 0 2 \gamma^2 \lt \omega_0^2 γ 2 < ω 0 2 Underdamped e − γ t ( c 1 cos ( ω d t ) + c 2 sin ( ω d t ) ) e^{-\gamma t}(c_1 \cos(\omega_d t) + c_2 \sin(\omega_d t)) e − γ t ( c 1 cos ( ω d t ) + c 2 sin ( ω d t )) , ω d = ω 0 2 − γ 2 \omega_d = \sqrt{\omega_0^2 - \gamma^2} ω d = ω 0 2 − γ 2 γ 2 = ω 0 2 \gamma^2 = \omega_0^2 γ 2 = ω 0 2 Critical e − γ t ( c 1 + c 2 t ) e^{-\gamma t}(c_1 + c_2 t) e − γ t ( c 1 + c 2 t ) γ 2 > ω 0 2 \gamma^2 > \omega_0^2 γ 2 > ω 0 2 Overdamped c 1 e r 1 t + c 2 e r 2 t c_1 e^{r_1 t} + c_2 e^{r_2 t} c 1 e r 1 t + c 2 e r 2 t , r 1 , 2 = − γ ± γ 2 − ω 0 2 r_{1,2} = -\gamma \pm \sqrt{\gamma^2 - \omega_0^2} r 1 , 2 = − γ ± γ 2 − ω 0 2
Damped Harmonic Oscillator
The underdamped oscillation e − γ t cos ( ω d t ) e^{-\gamma t}\cos(\omega_d t) e − γ t cos ( ω d t ) (blue) decays inside the envelope ± e − γ t \pm e^{-\gamma t} ± e − γ t (green/red). Adjust sliders c (damping γ \gamma γ ) and w (damped frequency ω d \omega_d ω d ) to explore different regimes.
:::caution Common Pitfall When using undetermined coefficients, always check whether your guess Overlaps with the homogeneous solution. For y ′ ′ − 4 y = e 2 x y'' - 4y = e^{2x} y ′′ − 4 y = e 2 x Guessing y p = A e 2 x y_p = Ae^{2x} y p = A e 2 x fails Because e 2 x e^{2x} e 2 x satisfies the homogeneous equation. You must use y p = A x e 2 x y_p = Axe^{2x} y p = A x e 2 x instead. :::
:::caution Common Pitfall For Euler-Cauchy equations, the substitution y = x r y = x^r y = x r only works for x > 0 x > 0 x > 0 . For x < 0 x < 0 x < 0 Substitute x = − e t x = -e^t x = − e t or use y = ( − x ) r y = (-x)^r y = ( − x ) r . :::
:::caution Common Pitfall Variation of parameters always works but can lead to difficult integrals. If the forcing term g ( x ) g(x) g ( x ) is a polynomial, exponential, sine, or cosine (or products of these), Prefer undetermined coefficients --- it is much faster.
Theorem 3.6 (Abel’s Identity). If y 1 , y 2 y_1, y_2 y 1 , y 2 are solutions of y ′ ′ + p ( x ) y ′ + q ( x ) y = 0 y'' + p(x)y' + q(x)y = 0 y ′′ + p ( x ) y ′ + q ( x ) y = 0 Then their Wronskian satisfies
W ( x ) = W ( x 0 ) e − ∫ x 0 x p ( t ) d t W(x) = W(x_0) e^{-\int_{x_0}^x p(t)\, dt} W ( x ) = W ( x 0 ) e − ∫ x 0 x p ( t ) d t
Proof. Since y 1 , y 2 y_1, y_2 y 1 , y 2 satisfy the ODE:
y 1 ′ ′ = − p y 1 ′ − q y 1 y_1'' = -py_1' - qy_1 y 1 ′′ = − p y 1 ′ − q y 1 and y 2 ′ ′ = − p y 2 ′ − q y 2 y_2'' = -py_2' - qy_2 y 2 ′′ = − p y 2 ′ − q y 2 .
W ′ = y 1 y 2 ′ ′ + y 1 ′ y 2 ′ − y 1 ′ ′ y 2 − y 1 ′ y 2 ′ W' = y_1 y_2'' + y_1' y_2' - y_1'' y_2 - y_1' y_2' W ′ = y 1 y 2 ′′ + y 1 ′ y 2 ′ − y 1 ′′ y 2 − y 1 ′ y 2 ′
= y 1 ( − p y 2 ′ − q y 2 ) − ( − p y 1 ′ − q y 1 ) y 2 = y_1(-py_2' - qy_2) - (-py_1' - qy_1)y_2 = y 1 ( − p y 2 ′ − q y 2 ) − ( − p y 1 ′ − q y 1 ) y 2
= − p ( y 1 y 2 ′ − y 1 ′ y 2 ) = − p W = -p(y_1 y_2' - y_1' y_2) = -pW = − p ( y 1 y 2 ′ − y 1 ′ y 2 ) = − p W .
So W ′ + p W = 0 W' + pW = 0 W ′ + p W = 0 Giving W = C e − ∫ p d x W = Ce^{-\int p\, dx} W = C e − ∫ p d x And evaluating at x 0 x_0 x 0 gives the result. ■ \blacksquare ■
Corollary. W ( x ) W(x) W ( x ) is either identically zero or never zero.
Problem. Solve y ′ ′ − 4 y = x e x y'' - 4y = xe^x y ′′ − 4 y = x e x using variation of parameters.
Solution Solution. Homogeneous: r 2 − 4 = 0 r^2 - 4 = 0 r 2 − 4 = 0 , r = ± 2 r = \pm 2 r = ± 2 . y 1 = e 2 x y_1 = e^{2x} y 1 = e 2 x , y 2 = e − 2 x y_2 = e^{-2x} y 2 = e − 2 x .
W = e 2 x ( − 2 e − 2 x ) − e − 2 x ( 2 e 2 x ) = − 4 W = e^{2x}(-2e^{-2x}) - e^{-2x}(2e^{2x}) = -4 W = e 2 x ( − 2 e − 2 x ) − e − 2 x ( 2 e 2 x ) = − 4 .
u 1 ′ = − y 2 g W = − e − 2 x ⋅ x e x − 4 = x e − x 4 u_1' = -\frac{y_2 g}{W} = -\frac{e^{-2x} \cdot xe^x}{-4} = \frac{xe^{-x}}{4} u 1 ′ = − W y 2 g = − − 4 e − 2 x ⋅ x e x = 4 x e − x .
u 1 = 1 4 ∫ x e − x d x = 1 4 ( − x e − x − e − x ) + C 1 = − ( x + 1 ) e − x 4 u_1 = \frac{1}{4}\int xe^{-x}\, dx = \frac{1}{4}(-xe^{-x} - e^{-x}) + C_1 = -\frac{(x+1)e^{-x}}{4} u 1 = 4 1 ∫ x e − x d x = 4 1 ( − x e − x − e − x ) + C 1 = − 4 ( x + 1 ) e − x .
u 2 ′ = y 1 g W = e 2 x ⋅ x e x − 4 = − x e 3 x 4 u_2' = \frac{y_1 g}{W} = \frac{e^{2x} \cdot xe^x}{-4} = -\frac{xe^{3x}}{4} u 2 ′ = W y 1 g = − 4 e 2 x ⋅ x e x = − 4 x e 3 x .
u 2 = − 1 4 ∫ x e 3 x d x = − 1 4 ( x e 3 x 3 − e 3 x 9 ) + C 2 = − ( 3 x − 1 ) e 3 x 36 u_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} u 2 = − 4 1 ∫ x e 3 x d x = − 4 1 ( 3 x e 3 x − 9 e 3 x ) + C 2 = − 36 ( 3 x − 1 ) e 3 x .
y p = u 1 y 1 + u 2 y 2 = − ( x + 1 ) e − x 4 ⋅ e 2 x + ( − ( 3 x − 1 ) e 3 x 36 ) ⋅ e − 2 x y_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} y p = u 1 y 1 + u 2 y 2 = − 4 ( x + 1 ) e − x ⋅ e 2 x + ( − 36 ( 3 x − 1 ) e 3 x ) ⋅ e − 2 x
= − ( x + 1 ) e x 4 − ( 3 x − 1 ) e x 36 = e x ( − 9 ( x + 1 ) 36 − 3 x − 1 36 ) = e x ( − 9 x − 9 − 3 x + 1 36 ) = − ( x + 2 ) e x 9 = -\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} = − 4 ( x + 1 ) e x − 36 ( 3 x − 1 ) e x = e x ( − 36 9 ( x + 1 ) − 36 3 x − 1 ) = e x ( 36 − 9 x − 9 − 3 x + 1 ) = − 9 ( x + 2 ) e x .
y = c 1 e 2 x + c 2 e − 2 x − ( x + 2 ) e x 9 y = c_1 e^{2x} + c_2 e^{-2x} - \frac{(x+2)e^x}{9} y = c 1 e 2 x + c 2 e − 2 x − 9 ( x + 2 ) e x . ■ \blacksquare ■
:::