Today we go over the differences between linear and nonlinear differential equations. Given an initial value problem (IVP)

$$ \frac{dy}{dt} = f(t,y),~y(t_0)=y_0 $$so far we took it for granted that there always exists a unique solution. At least, it was the case for all of the ODEs we came across during the first four lectures. But is that the case for any ODE? The question is two-fold:

- Existence: Is there always a differentiable function that satisfies the given ODE and the initial condition?
- Uniqueness: Is that function the only one?

There are two theorems that address these question. The first one concerns the initial value problems for first order *linear* ODEs:

**Theorem 2.4.1** If the functions $p$ and $g$ are are continuous on an open interval $I=(\alpha,\beta)$ containing the point $t=t_0$ (the initial point), then there exists a *unique* function $y=\varphi(t)$ that satisfies the ODE
$$
y'+p(t)y=g(t)
$$
for each $t$ in $I$, and that also satifies the initial condition $y(t_0)=y_0$.

Here $y_0$ is a prescribed arbitrary value of the solution sought after. As you can see from the statement of the theorem, the interval of existence for the solution is the interval $I$ where the coefficient functions $p(t)$ and $g(t)$ are both continuous. Note that this theorem gives both the **existence** and the **uniqueness** of solutions for first order linear ODEs. According to this theorem:

- If $p(t)$ or $g(t)$ has a discontinuity at a point, the solution of the ODE ceases to exist at that point.
- In case $p(t)$ and $g(t)$ are both continuous on an infinite interval, such as $(-\infty,\beta)$ or $(\alpha,+\infty)$, or $(-\infty, +\infty)$, the solution of the IVP also have an infinite interval of existence. The point is, $\alpha$ or $\beta$ can be infinite.

We apply this theorem in an example.

Consider the IVP

$$ (4-t^2)y'+2ty=3t^2,~y(-3)=1. $$Rewrite the ODE in standard form

$$ y'+\frac{2t}{4-t^2}y=\frac{3t^2}{4-t^2}. $$Observe that both

$$ p(t):=\frac{2t}{4-t^2}~ \text{ and } ~g(t):=\frac{3t^2}{4-t^2} $$are continuous on the intevals $(-\infty,-2)$, $(-2,2)$, and $(2,+\infty)$. The initial point $t_0=-3$ lies in the interval $(-\infty,-2)$. Therefore this IVP has a unique solution on the inteval $(-\infty,-2)$. **Exercise:** Solve the IVP and verify this.

Now, how about first order **nonlinear** equations?

The existence and uniquness theory for nonlinear equations is more subtle. The second theorem we will see today concerns the initial value problems for first order *nonlinear* equations:

**Theorem 2.4.2** Suppose that the functions $f$ and $\frac{\partial f}{\partial y}$ are continuous in some open rectangle $\alpha \lt t_0 \lt \beta$, $ \gamma \lt y \lt \delta $ containing the initial point $(t_0,y_0)$. Then, in some interval $t_0-h \lt t \lt t_0+h$ contained in the interval $\alpha \lt t \lt \beta$, the initial value problem
$$
y'=f(t,y),~y(t_0)=y_0.
$$
has a *unique* solution $y=\varphi(t)$.

Note that the conditions on this theorem reduce to those in Theorem 2.4.1 if the equation is linear. That is, if $f(y,t)=g(t)-p(t)y$, then $\frac{\partial f}{\partial y}=-p(t)$, and hence $f$ and $\frac{\partial f}{\partial y}$ are continuous if and only if $p$ and $g$ are continuous.

There are two points to be made here:

The conditions of the theorem above are

*sufficient*conditions to guarantee existence and uniqueness of solution to the IVP at hand. They are not necessary. The assumptions on $f$ can be weakened and the conclusion may still hold (this is beyond the scope of this course). In fact, the existence of a solution (but not its uniqueness) can be established on the basis of the continuity of $f$ alone.Uniqueness of solutions imply that the graphs of two solutions cannot intersect each other. Integral curves of an ODE satisfying the assumptions of these theorems do not intersect in the interval of existence and uniqueness given by the theorems. If two solution curves intersect at a point $t=t^*$ and $y=y^*$, then the IVP problem with the initial data $y(t^*)=y^*$ would have two different solutions.

Consider the IVP

$$ \frac{dy}{dt} = \frac{3t^2+4t+2}{2(y-1)},~ y(0)=-1. $$This is a nonlinear equation, we cannot use Theorem 2.4.1. Here

$$ f(t,y)=\frac{3t^2+4t+2}{2(y-1)}~\text{ and }~\frac{\partial f}{\partial y}(t,y)=-\frac{3t^2+4t+2}{2(y-1)^2} $$Both of these function are continuous everywhere in the $(t,y)$-plane except on the line $y=1$. Therefore, there exists an open rectangle around the initial point $(t_0, y_0)=(0,-1)$ (that does not intersect the line $y=1$), where both of the functions $f$ and $\frac{\partial f}{\partial y}$ are continuous. Then Theorem 2.4.2 implies that for some interval $$ -h \lt t \lt h $$ in this rectangle (meaning for some $h \gt 0$ small enough) there exists a unique solution $y=\phi(t)$ satisfying $\phi(0)=-1$. This is great, but what is $h$? We cannot tell at this stage without actually solving the ODE.

Note that, just by looking at the points of discontinuities of the functions

$$ f(t,y)=\frac{3t^2+4t+2}{2(y-1)}~\text{ and }~\frac{\partial f}{\partial y}(t,y)=-\frac{3t^2+4t+2}{2(y-1)^2} $$we may think that the common rectangle of continuity (containing the initial point $(0,-1)$) of these two functions can be extended infinitely in positive and negative $t$-directions, but that's not necessarily true. We do not know for what value of $t$ the solution $\varphi(t)$ will attain the value $y=1$. Indeed, we can analyze this by solving the ODE.

The ODE is separable, we can integrate and obtain a general solution:

\begin{align} \frac{dy}{dt} &= (3t^2+4t+2)\cdot\frac{1}{2(y-1)}\\ 2(y-1)\frac{dy}{dt} &= 3t^2+4t+2\\ \frac{d}{dt}\left(y^2-2y\right)&=3t^2+4t+2\\ y^2-2y &=t^3+2t^2+2t+c, \end{align}where $c$ is an arbitrary constant. Solving for $y$ gives (use the quadratic formula)

$$ y = 1\pm\sqrt{t^3+2t^2+2t+c+1} $$Now note that if $y(0)=-1$, then $c=3$. Since the initial value $y=-1$ is less than 1, we need to pick the negative branch of the expression above. Hence the solution of the IVP is

$$ \phi(t) = 1-\sqrt{t^3+2t^2+2t+4} $$Below is a plot of both branches: $y_1=1+\sqrt{t^3+2t^2+2t+4}$ and $y_2=\phi(t)=1-\sqrt{t^3+2t^2+2t+4}$. You can see in this plot that the initial value is on the branch $y_2$.

```
In [2]:
```using PlotlyJS;
# using Plots
# plotly()
timespan = -2:0.001:4;
tracesODE1 = GenericTrace[];
y0=-1.0
trace = scatter(x=timespan, y=1+sqrt(timespan.^3+2*timespan.^2+2*timespan+1+3), name = "y<sub>1</sub>(0)=$(y0)");
push!(tracesODE1, trace);
trace = scatter(x=timespan, y=1-sqrt(timespan.^3+2*timespan.^2+2*timespan+1+3), name = "y<sub>2</sub>(0)=$(y0)");
push!(tracesODE1, trace);
trace=scatter(x=[0],y=[-1], marker_size=12, name="Initial data");
push!(tracesODE1, trace);
plot(tracesODE1, Layout(title="Unique solution vs. the other branch", xaxis=attr(title="t"),yaxis=attr(title="y(t)")))

```
```