---
title: Existence and uniqueness
heading: When a model can't decide, or runs out of time
eyebrow: A8 · Lesson 11 · Existence and uniqueness
xp: 40
---

::: hook
A tank drains through a hole until it's empty. Now run the film backward: you see an empty tank, and you're asked when it was last full. You can't say. It might have emptied a minute ago or an hour ago, because once it's empty it stays empty and every history ends the same way. The equation describing it, $\dot h = -c\sqrt h$, really does have many solutions through the same point. Other equations have solutions that shoot off to infinity in a finite time. Before trusting a model, or a numerical solver, you want to know: does a solution exist, and is there only one?
:::

::: play
- The curve solves $\dot y = y^2$ starting from $y_0$: $y = \frac{y_0}{1 - y_0t}$.
- The right side, $y^2$, is perfectly smooth. Yet the solution doesn't last forever. When does it end?
- Double $y_0$. What happens to the time it lasts?
:::
:::

```sim plot
view: graph
x: t = 0..3
y: y = 0..20
slider: y0 = 0.4..3 step 0.1 = 1
plot: y0/(1 - y0*t)*step(1/y0 - t) | label: y = y₀/(1 − y₀t) | samples: 2000
readout: blows up at t = 1/y0 | digits: 3
```

::: predict
## The solution of $\dot y = y^2$ with $y(0) = 1$ is $y = \frac{1}{1 - t}$. What happens at $t = 1$?

- [ ] It levels off at a large value
- [x] It reaches infinity: the solution exists only for $t < 1$
- [ ] It turns around and decreases
- [ ] Nothing special

::: reveal
It blows up. The faster $y$ grows, the faster it grows, and the growth outruns any exponential: $y^2$ feeds on itself. A solution can exist only for a limited time even when the equation looks perfectly smooth. Linear equations never do this; it takes nonlinear growth.
:::
:::

::: nameit
## The existence and uniqueness theorem

For $\dot y = f(t, y)$ with $y(t_0) = y_0$: if $f$ and $\frac{\partial f}{\partial y}$ are continuous near $(t_0, y_0)$, then there is exactly one solution, at least on some interval around $t_0$.

Two things this does and doesn't promise:

- **Uniqueness:** solutions can't cross or touch. Two different starting values give solutions that stay apart.
- **Only locally:** the interval may be short. The solution may blow up, as $\dot y = y^2$ does.

## When uniqueness fails

If $\frac{\partial f}{\partial y}$ is infinite somewhere, uniqueness can fail there. The standard example is $\dot y = 3y^{2/3}$ with $y(0) = 0$: both $y = 0$ and $y = t^3$ work, and so does any solution that sits at 0 for a while and then follows $(t - c)^3$. The draining tank, $\dot h = -c\sqrt h$, is the same story run backward from $h = 0$.

## When existence is only local

$\dot y = y^2$ from $y_0 > 0$ blows up at $t = 1/y_0$; $\dot y = 1 + y^2$ from 0 gives $y = \tan t$, which blows up at $\pi/2$. Growth faster than linear in $y$ is the warning sign.

## Linear equations are safe

For $\dot y + p(t)y = q(t)$ with $p$ and $q$ continuous on an interval, the solution exists and is unique **on the whole interval**. Circuits built from linear parts never blow up in finite time.

## Why engineers care

Numerical solvers assume a unique solution and step along it. Ideal models with corners, such as an ideal diode or switch, or a $\sqrt{\ }$ law, can break the assumption, and a simulator may stall or jump. Real simulators smooth such models slightly to keep $\partial f/\partial y$ finite.
:::

::: example
## Find all solutions of $\dot y = 3y^{2/3}$ with $y(0) = 0$.

::: solution
1. **The zero solution.** $y = 0$ works.
2. **Separate.**
   $$\frac{dy}{3y^{2/3}} = dt$$
   gives $y^{1/3} = t + C$, and $C = 0$ gives $y = t^3$.
3. **Splice them.** For any $c \ge 0$, $y = 0$ for $t \le c$ and $(t - c)^3$ after is also a solution.
4. **Why uniqueness fails.** Infinitely many solutions share the same start, because
   $$\frac{\partial f}{\partial y} = 2y^{-1/3}$$
   is infinite at $y = 0$.

**Answer:** infinitely many: $y = 0$, $y = t^3$, and for every $c \ge 0$ the solution that stays at 0 until $t = c$ and then follows $(t - c)^3$.
:::
:::

::: example
## When does the solution of $\dot y = 1 + y^2$, $y(0) = 0$, blow up?

::: solution
1. **Separate.**
   $$\frac{dy}{1 + y^2} = dt$$
2. **Integrate.** $\tan^{-1}y = t$, so
   $$y = \tan t$$
3. **Find the blow-up.** It reaches infinity at
   $$\begin{aligned} t &= \frac{\pi}{2} \\ &= 1.571 \end{aligned}$$
4. **What it shows.** Even with the "+1" pushing it from zero, the solution exists for less than two time units.

**Answer:** $y = \tan t$ blows up at $t = \pi/2 = 1.571$.
:::
:::

::: example
## How long does the solution of $\dot y = y^2$, $y(0) = 2$, exist?

::: solution
1. **Separate and integrate.**
   $$-\frac1y = t + C$$
2. **Fit the start.** $y(0) = 2$ gives $C = -\frac12$, so
   $$y = \frac{2}{1 - 2t}$$
3. **Find the blow-up.** It blows up at $t = 0.5$.
4. **What the theorem promises.** The right side $y^2$ is perfectly smooth, so the theorem guarantees a unique solution, but only locally: the larger the start, the sooner it escapes. From $y(0) = 20$ it would last only 0.05.

**Answer:** $y = 2/(1 - 2t)$ exists only until $t = 0.5$.
:::
:::

::: check
given: y0 = 0.5 | 2 | 4
answer: 1/y0
tolerance: 0.5%

## The solution of $\dot y = y^2$ with $y(0) = \given{y0}$ blows up at what time?

::: right
Right. $y = \frac{y_0}{1 - y_0t}$ reaches infinity at $t = 1/y_0$ = {answer}.
:::

::: misses
- [y0] Larger $y_0$ blows up sooner, so the time is $1/y_0$.
- [any] Not yet. Find where the denominator $1 - y_0t$ is zero.
:::
:::

::: check
given: k = 0.5 | 2; y0 = 1 | 3
answer: 1/(k*y0)
tolerance: 0.5%

## The solution of $\dot y = \given{k}y^2$ with $y(0) = \given{y0}$ blows up at what time?

::: right
Right. $\frac{1}{y} = \frac{1}{y_0} - kt$ reaches zero at $t = \frac{1}{ky_0}$ = {answer}.
:::

::: misses
- [1/y0] Include $k$: the bigger $k$, the sooner.
- [k/y0] Separate carefully: $\frac{dy}{y^2} = k\,dt$.
- [any] Not yet. Solve and find where $y$ is infinite.
:::
:::

::: check
given: a = 4 | 2 | 0.5
answer: pi/(2*a)
tolerance: 0.5%

## The solution of $\dot y = \given{a}(1 + y^2)$ with $y(0) = 0$ blows up at what time?

::: right
Right. $y = \tan(at)$ reaches infinity at $at = \frac{\pi}{2}$: $t$ = {answer}.
:::

::: misses
- [pi/2] Include $a$: $y = \tan(at)$.
- [any] Not yet. Separate: $\frac{dy}{1 + y^2} = a\,dt$.
:::
:::

::: check
given: t = 0.5 | 2 | 3
answer: t^3
tolerance: 0.5%

## $\dot y = 3y^{2/3}$, $y(0) = 0$ has a solution other than $y = 0$. What is it at $t$ = {t}?

::: right
Right. $y = t^3$ = {answer}; check: $\dot y = 3t^2 = 3(t^3)^{2/3}$.
:::

::: misses
- [0] That's one solution; the question asks for the other.
- [t^2] Check: $3y^{2/3}$ with $y = t^2$ is $3t^{4/3}$, not $2t$.
- [any] Not yet. Separate and integrate.
:::
:::

::: check
kind: choice

## Which starting-value problem may have more than one solution?

- [x] $\dot y = \sqrt{|y|}$, $y(0) = 0$
- [ ] $\dot y = y^2$, $y(0) = 1$
- [ ] $\dot y = \sin y$, $y(0) = 0$
- [ ] $\dot y = -2y + t$, $y(0) = 0$

::: right
Right. $\frac{\partial f}{\partial y}$ is infinite at $y = 0$; both $y = 0$ and $y = t^2/4$ work.
:::

::: misses
- [2] That one blows up, but it's unique while it lasts.
- [3] $\cos y$ is continuous, so the solution ($y = 0$) is unique.
- [4] Linear with continuous coefficients: unique.
- [any] Look for a $\partial f/\partial y$ that's infinite at the start.
:::
:::

::: check
kind: choice

## $\dot y + \dfrac{y}{1 + t^2} = \cos t$, $y(0) = 5$. Where does a unique solution exist?

- [x] For all $t$
- [ ] Only near $t = 0$
- [ ] Only for $t > 0$
- [ ] Only until it blows up

::: right
Right. It's linear with $p$ and $q$ continuous everywhere, so the solution exists and is unique on the whole line.
:::

::: misses
- [2] For linear equations the interval is the whole range where $p$ and $q$ are continuous.
- [4] Linear equations can't blow up in finite time.
- [any] Is it linear, and where are its coefficients continuous?
:::
:::

::: check
kind: parts
given: y0 = 2 | 4 | 5

## Solve $\dot y = y^2$ with $y(0)$ = {y0}.

::: part
answer: 1/y0
tolerance: 0.5%

### When does the solution blow up?

::: misses
- [y0] $y = \frac{y_0}{1 - y_0t}$.
- [any] Separate: $-\frac1y = t - \frac{1}{y_0}$.
:::
:::

::: part
answer: 2*y0
tolerance: 0.5%

### What is $y$ halfway to that time?

::: misses
- [any] $\frac{y_0}{1 - 1/2}$.
:::
:::
:::

::: check
kind: derivation
vars: t = 0..1.4

## Solve $\dot y = 1 + y^2$ with $y(0) = 0$.

::: step
answer: tan(t)

### Separating gives $\tan^{-1}y = t$. What is $y$?
:::

::: step
answer: 1/cos(t)^2

### What is $\dot y$?
:::

::: right
Right. $y = \tan t$, which escapes to infinity at $t = \pi/2$ even though the right side is smooth.
:::
:::

::: explain
## A tank drains by $\dot h = -c\sqrt h$. You find it empty. Explain why the equation can't tell you when it emptied.

::: model
Once $h = 0$ the outflow stops, so $h = 0$ forever is a solution. But a solution that was draining and reached zero at any earlier time also arrives at $h = 0$ and then stays there. So many different histories pass through the same state "empty now", and running the equation backward from that state can't pick one. This happens because $\frac{\partial f}{\partial h} = -\frac{c}{2\sqrt h}$ is infinite at $h = 0$, which is exactly where the uniqueness theorem stops applying.
:::
:::

::: practice

::: check
given: y0 = 0.1 | 0.25 | 0.5 | 2 | 4 | 5 | 10
answer: 1/y0
tolerance: 0.5%

## How long does the solution of $\dot y = y^2$ from $y(0) = \given{y0}$ last?

::: misses
- [any] Until $1 - y_0t = 0$.
:::
:::

::: check
given: t = 1..10 int
answer: t^2/4
tolerance: 0.5%

## $\dot y = \sqrt{y}$, $y(0) = 0$, has the solution $y = t^2/4$ besides $y = 0$. What is it at $t$ = {t}?

::: misses
- [t^2/2] Check: $\dot y = t/2 = \sqrt{t^2/4}$ only with the 4.
- [any] $t^2/4$.
:::
:::

::: check
given: a = 1..9 int
answer: pi/(2*a)
tolerance: 0.5%

## For how long does the solution of $\dot y = \given{a} + \given{a}y^2$, $y(0) = 0$, exist (for $t > 0$)?

::: misses
- [any] $y = \tan(at)$.
:::
:::
:::
