---
title: Second-order linear equations
heading: Two energy stores, two numbers to start
eyebrow: A8 · Lesson 17 · Second-order linear equations
xp: 40
---

::: hook
A circuit with one capacitor needs one number to say where it starts: the capacitor's voltage. Add an inductor and you need two, the capacitor's voltage and the inductor's current, because each stores energy independently. The equation becomes second order, $\ddot y + p\dot y + qy = 0$, and its solutions are built from two basic ones. For a heavily damped RLC circuit those two are decaying exponentials with different time constants, and the response is a blend of a fast decay and a slow one.
:::

::: play
- The curve is $y = c_1e^{r_1t} + c_2e^{r_2t}$, starting at $y = 1$ with zero slope. The other two curves are its two pieces.
- Move the roots $r_1$ and $r_2$. Starting with zero slope needs one piece positive and one negative.
- Which root controls the long tail?
:::
:::

```sim plot
view: graph
x: t = 0..6
y: y = -2..3
slider: r1 = -2..-0.2 step 0.1 = -0.5
slider: r2 = -6..-2.2 step 0.1 = -3
plot: r2/(r2 - r1)*exp(r1*t) - r1/(r2 - r1)*exp(r2*t) | label: y
plot: r2/(r2 - r1)*exp(r1*t) | label: slow piece | color: ch2
plot: -r1/(r2 - r1)*exp(r2*t) | label: fast piece | color: ch3
readout: c1 = r2/(r2 - r1) | digits: 3
readout: c2 = -r1/(r2 - r1) | digits: 3
```

::: predict
## $y_1$ and $y_2$ both solve $\ddot y + 5\dot y + 6y = 0$. Does $3y_1 - 2y_2$?

- [x] Yes: any combination of solutions is a solution
- [ ] No: only $y_1 + y_2$
- [ ] Only if $y_1 = y_2$
- [ ] Only at $t = 0$

::: reveal
Yes. The equation is linear and homogeneous, so substituting $c_1y_1 + c_2y_2$ gives $c_1(\text{zero}) + c_2(\text{zero}) = 0$. This **superposition** is why two basic solutions are enough: every solution is a combination of them.
:::
:::

::: nameit
## The general solution

For $\ddot y + p(t)\dot y + q(t)y = 0$:

- **Superposition:** if $y_1$ and $y_2$ are solutions, so is $c_1y_1 + c_2y_2$.
- If $y_1$ and $y_2$ are **independent** (neither a multiple of the other), every solution is $c_1y_1 + c_2y_2$.
- Two numbers, $y(0)$ and $\dot y(0)$, pin down $c_1$ and $c_2$.

Independence is tested by the **Wronskian**:

$$W = \begin{vmatrix}y_1 & y_2\\\dot y_1 & \dot y_2\end{vmatrix} = y_1\dot y_2 - \dot y_1y_2$$

If $W \ne 0$, the matching equations for $c_1$, $c_2$ always have a unique solution, the 2 × 2 determinant of A7.

## Constant coefficients

For $\ddot y + p\dot y + qy = 0$ with constants $p$, $q$, try $y = e^{rt}$: it works when

$$r^2 + pr + q = 0$$

the **characteristic equation**. Its roots decide everything:

| Roots | Solutions | RLC case |
|---|---|---|
| Real, distinct $r_1, r_2$ | $e^{r_1t}$, $e^{r_2t}$ | overdamped |
| Repeated $r$ | $e^{rt}$, $te^{rt}$ | critically damped (lesson 21) |
| Complex $\sigma \pm j\omega$ | $e^{\sigma t}\cos\omega t$, $e^{\sigma t}\sin\omega t$ | underdamped (lesson 20) |

## The overdamped response

With two negative real roots, the response is a mix of two decays. The root closer to zero decays more slowly and dominates the tail: the circuit's settling time is set by $\frac{1}{|r_\text{slow}|}$.
:::

::: example
## Solve $\ddot y + 5\dot y + 6y = 0$ with $y(0) = 1$, $\dot y(0) = 0$.

::: solution
1. **Characteristic roots.**
   $$r^2 + 5r + 6 = (r + 2)(r + 3)$$
   so $r = -2, -3$.
2. **General solution.**
   $$y = c_1e^{-2t} + c_2e^{-3t}$$
3. **Fit the start.** $y(0) = 1$ and $\dot y(0) = 0$ give
   $$\begin{aligned} c_1 + c_2 &= 1 \\ -2c_1 - 3c_2 &= 0 \end{aligned}$$
   so $c_1 = 3$ and $c_2 = -2$.

**Answer:** $y = 3e^{-2t} - 2e^{-3t}$.
:::
:::

::: example
## Check that $e^{-2t}$ and $e^{-3t}$ are independent.

::: solution
1. **Wronskian.**
   $$\begin{aligned} W &= e^{-2t}(-3e^{-3t}) \\ &\quad - (-2e^{-2t})e^{-3t} \\ &= -e^{-5t} \end{aligned}$$
   which is never zero.
2. **The general case.** $e^{r_1t}$ and $e^{r_2t}$ have
   $$W = (r_2 - r_1)e^{(r_1 + r_2)t}$$
   nonzero whenever the roots differ.

**Answer:** their Wronskian, $-e^{-5t}$, is never zero, so they're independent.
:::
:::

::: example
## Solve $\ddot y + 5\dot y + 6y = 0$ with $y(0) = 0$, $\dot y(0) = 1$, and find its peak.

::: solution
1. **General solution.** The roots are $-2$ and $-3$, so
   $$y = c_1e^{-2t} + c_2e^{-3t}$$
2. **Fit the start.** The conditions give
   $$\begin{aligned} c_1 + c_2 &= 0 \\ -2c_1 - 3c_2 &= 1 \end{aligned}$$
   so $c_1 = 1$ and $c_2 = -1$:
   $$y = e^{-2t} - e^{-3t}$$
3. **Time of the peak.** The peak is where $\dot y = 0$:
   $$-2e^{-2t} + 3e^{-3t} = 0$$
   so $e^{-t} = \frac23$ and $t = \ln 1.5 = 0.405$.
4. **Height of the peak.**
   $$\begin{aligned} y &= \left(\frac23\right)^2 - \left(\frac23\right)^3 \\ &= \frac{4}{27} \\ &= 0.148 \end{aligned}$$

**Answer:** $y = e^{-2t} - e^{-3t}$, which peaks at 0.148 when $t = 0.405$.
:::
:::

::: check
given: p = 5 | 7; q = 4 | 6
answer: (-p + sqrt(p^2 - 4*q))/2
tolerance: 0.5%

## What is the root closer to zero of $r^2 + \given{p}r + \given{q} = 0$?

::: right
Right. $\frac{-p + \sqrt{p^2 - 4q}}{2}$ = {answer}: the slow mode.
:::

::: misses
- [(-p - sqrt(p^2 - 4*q))/2] That's the faster root, further from zero.
- [any] Not yet. Use the quadratic formula.
:::
:::

::: check
given: r1 = -1 | -2; r2 = -4 | -5
answer: r2/(r2 - r1)
tolerance: 0.5%

## $y = c_1e^{\given{r1}t} + c_2e^{\given{r2}t}$ with $y(0) = 1$, $\dot y(0) = 0$. What is $c_1$?

::: right
Right. $c_1 + c_2 = 1$ and $r_1c_1 + r_2c_2 = 0$ give $c_1 = \frac{r_2}{r_2 - r_1}$ = {answer}.
:::

::: misses
- [-r1/(r2 - r1)] That's $c_2$.
- [1] With zero starting slope both pieces are needed.
- [any] Not yet. Solve the two matching equations.
:::
:::

::: check
given: t = 0.5 | 1 | 2
answer: 3*exp(-2*t) - 2*exp(-3*t)
tolerance: 0.5%

## For $y = 3e^{-2t} - 2e^{-3t}$, the solution of the worked example, what is $y(\given{t})$?

::: right
Right. {answer}.
:::

::: misses
- [3*exp(-2*t)] Include the fast piece, $-2e^{-3t}$.
- [any] Not yet. Evaluate both terms.
:::
:::

::: check
given: r1 = -1 | -0.5; r2 = -3 | -6
answer: r2 - r1

## What is the Wronskian of $e^{\given{r1}t}$ and $e^{\given{r2}t}$ at $t = 0$?

::: right
Right. $W(0) = 1 \cdot r_2 - r_1 \cdot 1$ = {answer}, nonzero, so they're independent.
:::

::: misses
- [r1 - r2] $W = y_1\dot y_2 - \dot y_1y_2$: the order matters for the sign.
- [r1*r2] Compute the determinant $\begin{vmatrix}1 & 1\\r_1 & r_2\end{vmatrix}$.
- [any] Not yet. Evaluate $y_1\dot y_2 - \dot y_1y_2$ at 0.
:::
:::

::: check
given: y0 = 1 | 2; v0 = -1 | 3
answer: 3*y0 + v0
tolerance: 0.5%

## Solve $\ddot y + 5\dot y + 6y = 0$ with $y(0) = \given{y0}$ and $\dot y(0) = \given{v0}$. In $y = c_1e^{-2t} + c_2e^{-3t}$, what is $c_1$?

::: right
Right. $c_1 + c_2 = y_0$ and $-2c_1 - 3c_2 = v_0$ give $c_1 = 3y_0 + v_0$ = {answer}.
:::

::: misses
- [y0] Both pieces share the starting value.
- [any] Not yet. Solve the two matching equations.
:::
:::

::: check
kind: choice

## Why does an RLC circuit need two starting conditions where an RC circuit needs one?

- [x] It stores energy in two places, the capacitor and the inductor, each with its own state
- [ ] Because inductors are nonlinear
- [ ] Because the resistor adds a condition
- [ ] It doesn't; one is enough

::: right
Right. The capacitor's voltage and the inductor's current can each start anywhere; together they determine the future.
:::

::: misses
- [3] Resistors store no energy, so they add no state.
- [any] Count the independent energy stores.
:::
:::

::: check
kind: parts
given: v0 = 2 | 3 | 5

## Solve $\ddot y + 5\dot y + 6y = 0$ with $y(0) = 0$, $\dot y(0)$ = {v0}.

::: part
answer: ln(1.5)
tolerance: 0.5%

### When does $y$ peak?

::: misses
- [any] $\dot y = v_0(-2e^{-2t} + 3e^{-3t}) = 0$ when $e^{-t} = \frac23$.
:::
:::

::: part
answer: v0*4/27
tolerance: 0.5%

### What is the peak value?

::: misses
- [4/27] Scale by the initial slope {v0}.
- [any] $y = v_0(e^{-2t} - e^{-3t})$.
:::
:::
:::

::: check
kind: derivation
vars: a = 1..4, b = 5..9

## Solve $\ddot y + (a + b)\dot y + aby = 0$ with $y(0) = 1$, $\dot y(0) = 0$; the roots are $-a$ and $-b$.

::: step
answer: b/(b - a)

### What is the coefficient of $e^{-at}$?
:::

::: step
answer: -a/(b - a)

### And of $e^{-bt}$?
:::

::: right
Right. $y = \frac{be^{-at} - ae^{-bt}}{b - a}$: the slower root dominates later.
:::
:::

::: explain
## For an overdamped circuit with roots $r_1$ and $r_2$, why does the root closer to zero set the settling time?

::: model
The response is $c_1e^{r_1t} + c_2e^{r_2t}$. Both pieces decay, but the one with the root nearer zero decays more slowly: its time constant $\frac{1}{|r|}$ is longer. After the fast piece has died away, only the slow piece is left, so how long the circuit takes to settle is governed by that slower time constant. Making the fast root faster changes little; moving the slow root is what speeds settling.
:::
:::

::: practice

::: check
given: a = 1 | 2; b = 4 | 5
answer: -a

## The characteristic equation is $(r + \given{a})(r + \given{b}) = 0$. What is the slow root?

::: misses
- [-b] That's the fast one.
- [any] The root closer to zero.
:::
:::

::: check
given: p = 6 | 8; q = 5 | 7
answer: -p

## What is the sum of the roots of $r^2 + \given{p}r + \given{q} = 0$?

::: misses
- [p] The sum is $-p$.
- [q] That's the product.
- [any] Sum of roots $= -p$.
:::
:::

::: check
given: c1 = 2 | 3; c2 = -1 | 1; t = 1 | 2
answer: c1*exp(-t) + c2*exp(-4*t)
tolerance: 0.5%

## $y = \given{c1}e^{-t} + \given{c2}e^{-4t}$. What is $y(\given{t})$?

::: misses
- [any] Evaluate both terms.
:::
:::
:::
