Second-Order ODE with Complex Conjugate Roots

April 13, 2026

Problem

Solve y'' + 4y = 0. Find characteristic roots r = plus or minus 2i and write the real-valued general solution y = C1 cos(2x) + C2 sin(2x). Show the oscillation and its frequency.

Explanation

Setup

The ODE y+4y=0y'' + 4 y = 0 is the harmonic oscillator with angular frequency ω=2\omega = 2. Springs, pendulums (small-amplitude), LC circuits, and sound-wave equations all boil down to this shape.

Step-by-step solution

Step 1 — Characteristic equation. r2+4=0    r2=4    r=±2ir^{2} + 4 = 0 \implies r^{2} = -4 \implies r = \pm 2 i

Discriminant Δ=016=16<0\Delta = 0 - 16 = -16 < 0 → complex conjugate roots.

Step 2 — Build the real general solution.

With roots r=α±iβr = \alpha \pm i \beta the general real-valued solution is y(x)=eαx(C1cosβx+C2sinβx).y(x) = e^{\alpha x} \bigl(C_1 \cos \beta x + C_2 \sin \beta x\bigr).

Here α=0\alpha = 0, β=2\beta = 2: y(x)=C1cos(2x)+C2sin(2x)\boxed{\, y(x) = C_1 \cos(2 x) + C_2 \sin(2 x) \,}

Why cos and sin, not e±iβxe^{\pm i \beta x}?

Technically the general complex solution is y=Aeiβx+Beiβxy = A e^{i \beta x} + B e^{-i \beta x}. Using Euler's formula eiθ=cosθ+isinθe^{i\theta} = \cos\theta + i \sin\theta: Aeiβx+Beiβx=(A+B)cos(βx)+i(AB)sin(βx)A e^{i\beta x} + B e^{-i\beta x} = (A + B) \cos(\beta x) + i (A - B) \sin(\beta x)

For a real solution we need (A+B)R(A + B) \in \mathbb{R} and i(AB)Ri(A - B) \in \mathbb{R}, which forces B=AˉB = \bar{A}. Writing A=12(C1iC2)A = \frac{1}{2}(C_1 - i C_2) recovers y=C1cosβx+C2sinβxy = C_1 \cos \beta x + C_2 \sin \beta x with C1,C2RC_1, C_2 \in \mathbb{R}.

That's the bridge from the complex algebra of the characteristic equation to the real-valued physical solution.

Verification

y=C1cos2x+C2sin2xy = C_1 \cos 2x + C_2 \sin 2x y=2C1sin2x+2C2cos2xy' = -2 C_1 \sin 2x + 2 C_2 \cos 2x y=4C1cos2x4C2sin2x=4yy'' = -4 C_1 \cos 2x - 4 C_2 \sin 2x = -4 y

So y+4y=4y+4y=0y'' + 4 y = -4 y + 4 y = 0. ✓

Amplitude–phase form

The same solution can be written as a single cosine with amplitude AA and phase φ\varphi: y(x)=Acos(βxφ)y(x) = A \cos(\beta x - \varphi) where A=C12+C22,tanφ=C2C1.A = \sqrt{C_1^{2} + C_2^{2}}, \qquad \tan \varphi = \frac{C_2}{C_1}.

Expanding cos(βxφ)=cos(βx)cosφ+sin(βx)sinφ\cos(\beta x - \varphi) = \cos(\beta x) \cos\varphi + \sin(\beta x) \sin\varphi gives C1=AcosφC_1 = A \cos\varphi, C2=AsinφC_2 = A \sin\varphi — matching.

When to prefer which form?

  • C1,C2C_1, C_2 form is great for applying initial conditions cleanly (each IC plugs straight into one constant).
  • Amplitude–phase form is great for reading off size of oscillation and timing relative to a reference.

Initial value problem

y(0)=3y(0) = 3, y(0)=4y'(0) = -4. y(0)=C1=3y(0) = C_1 = 3 y(0)=2C2=4    C2=2y'(0) = 2 C_2 = -4 \implies C_2 = -2 y(x)=3cos2x2sin2xy(x) = 3 \cos 2x - 2 \sin 2x

Amplitude A=9+4=13A = \sqrt{9 + 4} = \sqrt{13}; phase φ=arctan(2/3)0.588\varphi = \arctan(-2/3) \approx -0.588 rad.

Physical interpretation — simple harmonic motion

my+ky=0m y'' + k y = 0 describes a mass on a spring with no friction. Characteristic roots r=±ik/mr = \pm i \sqrt{k/m}, so solutions are cos(ωt)\cos(\omega t), sin(ωt)\sin(\omega t) with natural frequency ω=k/m.\omega = \sqrt{k/m}.

Our problem, y+4y=0y'' + 4 y = 0, has k/m=4k/m = 4, ω=2\omega = 2 — the oscillation completes one full cycle every T=2π/ω=πT = 2\pi / \omega = \pi units of xx.

With damping — α0\alpha \ne 0

If instead the ODE has a first-derivative term, y+2γy+ω02y=0y'' + 2 \gamma y' + \omega_0^2 y = 0, the roots are r=γ±γ2ω02.r = -\gamma \pm \sqrt{\gamma^{2} - \omega_0^{2}}.

  • γ<ω0\gamma < \omega_0 (under-damped): complex roots, α=γ<0\alpha = -\gamma < 0, β=ω02γ2\beta = \sqrt{\omega_0^2 - \gamma^2}. Solution y=eγx(C1cosβx+C2sinβx)y = e^{-\gamma x} (C_1 \cos \beta x + C_2 \sin \beta x) is an oscillation inside a decaying envelope.
  • γ=ω0\gamma = \omega_0 (critically damped): repeated real root, see #182/#185.
  • γ>ω0\gamma > \omega_0 (over-damped): real distinct roots, #183. No oscillation.

Our pure-oscillator y+4y=0y'' + 4 y = 0 is the un-damped limit (γ=0\gamma = 0, α=0\alpha = 0).

Common mistakes

  • Writing y=C1e2ix+C2e2ixy = C_1 e^{2 i x} + C_2 e^{-2 i x} as a final answer for a real problem. Complex exponentials are a useful intermediate, but the answer to a real ODE with real initial conditions should be real-valued.
  • Confusing frequency ω\omega with period TT. T=2π/ωT = 2\pi / \omega.
  • Using β=r\beta = |r| with complex rr. β\beta is the imaginary part, not the magnitude.
  • Dropping the eαxe^{\alpha x} envelope for damped oscillations. Pure oscillation only occurs when α=0\alpha = 0 (roots on the imaginary axis).

Try it in the visualization

Slide ω\omega (the coefficient of yy in the ODE) and watch the period shrink or grow. Enable damping to slide the roots off the imaginary axis — see the oscillation decay or explode. Overlay the amplitude–phase envelope to see where the peaks and zero-crossings land.

Interactive Visualization

Parameters

1.00
0.50
2.00
0.00
10.00
3.50
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Second-Order ODE with Complex Conjugate Roots | MathSpin