532 lines
12 KiB
Text
532 lines
12 KiB
Text
#import "@youwen/zen:0.1.0": *
|
|
|
|
#show: zen.with(
|
|
title: "Math 4B Course Notes",
|
|
author: "Youwen Wu",
|
|
date: "Winter 2025",
|
|
subtitle: [Taught by Guofang Wei],
|
|
)
|
|
|
|
#outline()
|
|
|
|
= Course logistics
|
|
|
|
The textbook is Elementary Differential Equations, 11th edition, 2017. Chapters
|
|
1-4, 6, 7, and 9 will be covered.
|
|
|
|
Attendance to discussion sections is mandatory.
|
|
|
|
= Lecture #datetime(day: 7, month: 1, year: 2025).display()
|
|
|
|
== Trivial preliminaries
|
|
|
|
#definition[
|
|
An ODE involves an unknown function of a single variable and its derivatives
|
|
up to some fixed order. The order of an ODE is the order of the highest
|
|
derivative that appears.
|
|
]
|
|
|
|
#example[First order ODE][
|
|
$ (dif y) / (dif x) = y^2 $
|
|
]
|
|
|
|
#example[Second order ODE][
|
|
$
|
|
y'' &= x \
|
|
integral.double y'' dif x &= integral.double x dif x \
|
|
y &= 1 / 6 x^3 + C
|
|
$
|
|
]
|
|
|
|
#definition[
|
|
A function $y(x)$ defined on $(a,b)$ is a *solution* of the ODE
|
|
$ y' = F(x,y) $
|
|
if and only if
|
|
$ y'(x) = F(x, y(x)), forall x in (a,b) $
|
|
]
|
|
|
|
#problem[
|
|
Check that $y(x) = 20 + 10e^(-x / 2)$ is a solution to the ODE
|
|
$ y' = -1 / 2 y + 10 $
|
|
]
|
|
|
|
#definition[
|
|
A first order ODE
|
|
$ y' = F(x,y) $
|
|
is called *linear* if there are functions $A(x)$ and $B(x)$ such that
|
|
$ F(x,y) = A(x) y + B(x) $
|
|
]
|
|
|
|
#example("Linear ODEs")[
|
|
- $y' = x$
|
|
- $y' = y$
|
|
- $y' = x^2$
|
|
]
|
|
|
|
#example("Nonlinear ODEs")[
|
|
- $y' = y^2$
|
|
]
|
|
|
|
#definition[
|
|
In general, a differential equation is called linear if and only if it can be
|
|
written in the form
|
|
$
|
|
a_n (t) (dif^n y) / (dif t^n) + a_(n-1) (t) (d^(n-1) y) / (d t^(n-1)) + dots + a_1 (t) (dif y) / (dif t) + a_0 (t) y = g(t)
|
|
$
|
|
where $a_k (t)$ and $g(t)$ are single variable functions of $t$.
|
|
]
|
|
|
|
#definition[
|
|
*Equilibrium solutions* for the ODE
|
|
$ y' = F(x,y) $
|
|
are solutions $y(x)$ such that $y'(x) = 0$, that is, $y(x)$ is constant.
|
|
]
|
|
|
|
#example[
|
|
The equation
|
|
$ y' = y(y +2) $
|
|
has two equilibria
|
|
$
|
|
y(x) &= 0 \
|
|
y(x) &= -2
|
|
$
|
|
]
|
|
|
|
#problem[
|
|
What are the equilibria of the equation
|
|
$ y' = y(y - x) $
|
|
]
|
|
|
|
== General solution of a first order linear ODE
|
|
|
|
We start with the differential equation in standard form
|
|
|
|
$ (dif y) / (dif t) + p(t) y = g(t) $
|
|
|
|
where $p(t)$ and $g(t)$ are continuous single variable functions of $t$.
|
|
|
|
Then let us assume the existence of an *integrating factor* $mu(t)$, such that
|
|
|
|
$ mu(t) p(t) = mu'(t) $
|
|
|
|
and then multiplying each term by $mu(t)$ to obtain
|
|
|
|
$ mu(t) (dif y) / (dif t) + mu(t) p(t) y = mu(t) g(t) $
|
|
|
|
Then
|
|
|
|
$ mu(t) (dif y) / (dif t) + mu'(t) y = mu(t) g(t) $
|
|
|
|
Then recognize that the left side of the equation is the product rule to obtain
|
|
|
|
$
|
|
(mu(t) y(t))' &= mu(t) g(t) \
|
|
integral (mu(t) y(t))' dif t &= integral mu(t) g(t) dif t \
|
|
mu(t) y(t) + C &= integral mu(t) g(t) dif t \
|
|
y(t) &= (integral mu(t) g(t) dif t + C) / (mu(t))
|
|
$
|
|
|
|
Now we have a general solution but we need to determine $mu(t)$.
|
|
|
|
$
|
|
mu(t) p(t) &= mu'(t) \
|
|
(mu'(t)) / (mu(t)) &= p(t) \
|
|
(ln mu(t))' &= p(t)
|
|
$
|
|
|
|
So now
|
|
|
|
$
|
|
integral mu(t) + k &= integral p(t) dif t \
|
|
ln mu(t) &= integral p(t) dif t + k \
|
|
mu(t) = e^(integral p(t) dif t + k) &= k e^(integral p(t) dif t)
|
|
$
|
|
|
|
Now substitute
|
|
|
|
$
|
|
y(t) &= (integral k e^(integral p(t) dif t) g(t) dif t + C) / (k e^(integral p(t))) \
|
|
&= (k integral e^(integral p(t) dif t) g(t) dif t + C) / (k e^(integral p(t)))
|
|
$
|
|
|
|
Now do some cursed constant manipulation to obtain a final solution with only one arbitrary constant
|
|
|
|
$
|
|
y(t) = (integral e^(integral p(t) dif t) g(t) dif t + C) / (e^(integral p(t)))
|
|
$
|
|
|
|
#remark[
|
|
The most useful result to us is
|
|
$
|
|
y(t) &= (integral mu(t) g(t) dif t + C) / (mu(t)) \
|
|
mu(t) &= e^(integral p(t) dif t)
|
|
$
|
|
We can easily obtain a solution form for any first order linear ODE simply by
|
|
identifying $p(t)$ and $g(t)$.
|
|
]
|
|
|
|
= Lecture #datetime(day: 22, year: 2025, month: 1).display() - existence and uniqueness of solutions
|
|
|
|
Midterm 1 is #datetime(month: 1, day: 28, year: 2025).display() in class, covering Chapter 2. Five problems:
|
|
|
|
- Solving separable equations (10pts)
|
|
- Solving Linear ODE (10pts)
|
|
- Modeling (Newton's law of cooling) (10pts)
|
|
- Eulers's method (5 pts)
|
|
- True or false problem (if ODE linear, existence, etc) (5 pts)
|
|
|
|
== Existence and uniqueness of solutions to the initial value problem
|
|
|
|
Before we looked at particular ODEs. Now we turn our attention to general ODEs.
|
|
In general ODEs do not have solutions, so let us discuss methods to identify
|
|
when solutions exist.
|
|
|
|
Given a first order initial value problem ODE
|
|
|
|
$ y' = F(t,y), underbrace(y(t_0) = y_0, "initial value") $
|
|
|
|
When does a solution exist? Is it unique?
|
|
|
|
Warm up:
|
|
|
|
$ y' = -x / y $
|
|
|
|
It's separable and we can solve it.
|
|
|
|
$
|
|
1 / 2 y^2 &= -1 / 2 x^2 + C \
|
|
y^2 &= 2C - x^2 \
|
|
y &= plus.minus sqrt(2C - x^2)
|
|
$
|
|
|
|
Say $y(1) = 1$. Then $C = 1$.
|
|
|
|
Since $y(1) = 1$, we choose the positive version of solution.
|
|
|
|
$ y = sqrt(2 - x^2) $
|
|
|
|
The slope field shows that the solutions are semicircles above and below the
|
|
$x$-axis.
|
|
|
|
Consider this initial value
|
|
|
|
$
|
|
y(3) &= 0 \
|
|
2C &= 9 \
|
|
y &= plus.minus sqrt(9 - x^2)
|
|
$
|
|
|
|
Now should we choose $+$ or $-$? It seems that either can work, but it turns
|
|
out that it is not a solution!
|
|
|
|
Recall the equation
|
|
|
|
$ y' = -x / y $
|
|
|
|
With our initial condition, this equation was not defined! So there is no
|
|
solution for this initial condition.
|
|
|
|
Now consider
|
|
|
|
$ y' = sqrt(y) $
|
|
|
|
Again it is separable
|
|
|
|
$
|
|
integral dif x &= integral sqrt(y) dif y \
|
|
2y^(1 / 2) &= x + C \
|
|
$
|
|
|
|
With initial condition $y(0) = 0$,
|
|
|
|
$
|
|
y = (x / 2)^2
|
|
$
|
|
|
|
However we lost a solution, since we divided by $sqrt(y)$, which could've been
|
|
0!
|
|
|
|
When $F(t,y)$ (RHS) is not nice (differentiable) at the initial value $(t_0,
|
|
y_0)$, existence and uniqueness (E/U) could fail. We do have E/U when $F(t,y)$
|
|
is nice.
|
|
|
|
== Existence of solutions to IVP - linear case
|
|
|
|
The first order linear ODE is
|
|
|
|
$
|
|
y'(t) = p(t) y(t) = g(t) \
|
|
$
|
|
|
|
Use integrating factor
|
|
|
|
$ mu(t) = e^(integral p(t) dif t) $
|
|
|
|
We know a general solution using the method of integrating factors.
|
|
|
|
$ y(t) = 1 / mu(t) [C + integral mu(t) g(t) dif t] $
|
|
|
|
We are assuming that $p(t)$ and $g(t)$ are given continuous functions defined
|
|
on some interval $I$. The solution $y(t)$ is defined on the same interval
|
|
$I$.
|
|
|
|
#remark[
|
|
The solution of the initial value problem for a linear equation exists, is
|
|
unique, and is defined as long as the coefficients in the equation are defined.
|
|
]
|
|
|
|
#remark[
|
|
Existence and uniqueness are important. It guarantees there is one and only one
|
|
solution curve passing through an initial point $(t_0, y_0)$.
|
|
]
|
|
|
|
#example[
|
|
Consider
|
|
$ y'(t) - 1 / t y(t) = 1 / (t^2), y(1) = 0 $
|
|
|
|
+ $(-infinity, 0)$
|
|
+ $(0, infinity)$
|
|
+ $(-infinity, infinity)$
|
|
+ $(0, 2)$
|
|
|
|
$0$ is a bad value. So we choose either $(0, infinity)$ or $(-infinity, 0)$.
|
|
But the initial value exists on $(0, infinity)$, so we choose (1).
|
|
]
|
|
|
|
Now let's consider a general first order ODE
|
|
|
|
$ y' = F(t,y), y(t_0) = y_0 $
|
|
|
|
Now "nice" is not so clear cut.
|
|
Assume $F(t,y)$ is a "nice" function ($F$, $(diff F)/(diff y)$ are continuous)
|
|
defined on some rectangle in $(t,y)$-plane.
|
|
|
|
#theorem("Existence and uniqueness theorem for ODE")[
|
|
If the initial point $(t_0, y_0)$ belongs to the rectangle where $F(t,y)$ is
|
|
defined, then this initial value problem has a *unique solution* $y(t)$ defined
|
|
on some time interval $I$.
|
|
]<eutheorem>
|
|
|
|
#example[
|
|
Find the solution of the initial value problem
|
|
$
|
|
y' = y^2, y(0) = 1 \
|
|
y(t) = 1 / (1-t)
|
|
$
|
|
|
|
The function on the right side is
|
|
$ F(t,y) = y^2 $
|
|
It's defined for all $t$ and $y$. Nevertheless the largest interval on which
|
|
the solution is defined is $-infinity < t < 1$.
|
|
]
|
|
|
|
Consider IVP
|
|
|
|
$
|
|
y' = sqrt(9 - y^2), y(1) = 0
|
|
$
|
|
|
|
Any E/U problems?
|
|
|
|
== Numerical approximations with Euler's method
|
|
|
|
We can determine if solutions exist using @eutheorem but in general we cannot
|
|
find an explicit solution. Instead we approximate the solution.
|
|
|
|
Consider the IVP
|
|
|
|
$ y' = 1 / 2 cos(y) + t, y(0) = -1 $
|
|
|
|
The righthand side is nice, by @eutheorem, it has a unique solution. We can't
|
|
find an explicit solution. So use Euler's method.
|
|
|
|
= Lecture #datetime(day: 23, month: 1, year: 2025).display()
|
|
|
|
Second order linear differential equation.
|
|
|
|
$
|
|
y'' = p(t)y' + q(t)y = g(t)
|
|
$
|
|
|
|
We say it is homogenous if $g(t) = 0$.
|
|
|
|
== Initial value problem and uniqueness on 2nd order linear ODEs
|
|
|
|
Suppose $p(t)$, $q(t)$, and $g(t)$ are given continuous functions defined on
|
|
$I$.
|
|
$
|
|
y'' = p(t)y' + q(t)y = g(t) \
|
|
y(t_0) = y_0, y'(t_0) = y'_0
|
|
$
|
|
|
|
has a unique solution $y(t)$ defined on $I$. Same as first order case. Always write in standard form first before identifying.
|
|
|
|
#example[
|
|
What is the largest interval on which the IVP
|
|
$
|
|
(t+1)y'' + y = 3, y(0) = 1, y'(0) = 0
|
|
$
|
|
is certain to have a solution?
|
|
|
|
$
|
|
y'' + 1 / (t+1) y = 3 / (t+1)
|
|
$
|
|
|
|
So the functions are nice except at -1. Our intervals are
|
|
|
|
$
|
|
(-infinity, -1), (-1, infinity)
|
|
$
|
|
|
|
But we have initial values at 0, so we know for certain that a solution (but not for certain it's the only solution) exists
|
|
|
|
$
|
|
(-1, infinity)
|
|
$
|
|
]
|
|
|
|
== 2nd order linear homogenous ODEs
|
|
|
|
How to find solutions to 2nd order linear ODE? Recall
|
|
|
|
$
|
|
y'' = p(t)y' + q(t)y = 0
|
|
$
|
|
|
|
Consider 2nd order linear homogenous ODEs with constant coefficients $a,b,c, a!= 0$.
|
|
|
|
$
|
|
a y'' + b y' + c y = 0
|
|
$
|
|
|
|
Judging from this equation it seems $y$ should be an exponential since we want
|
|
a function whose derivatives can cancel each other out (with constants
|
|
applied).
|
|
|
|
Trying $y=e^(r t)$,
|
|
|
|
$
|
|
y' = r e^(r t) \
|
|
y'' = r^2 e^(r t) \
|
|
a r^2 e^(r t) + b r e^(r t) + c e^(r t) = 0
|
|
$
|
|
|
|
$e^(r t)$ is never 0 (in $RR$) so we can divide without losing or gaining solutions.
|
|
|
|
$
|
|
e^(r t) (a r^2 + b r + c) = 0
|
|
$
|
|
|
|
Then we simply just need to solve a quadratic for $r$.
|
|
|
|
$
|
|
a r^2 + b r + c = 0
|
|
$
|
|
|
|
We may have two distinct real solutions, one repeated solution, or complex
|
|
solutions (no solutions in $RR$). For now let us consider the distinct real
|
|
solutions.
|
|
|
|
#fact[
|
|
We conclude $y(t) = e^(r t)$ is a solution of
|
|
$
|
|
a y'' + b y' + c y = 0
|
|
$
|
|
provided $r$ satisfies
|
|
$
|
|
a r^2 + b r + c = 0
|
|
$
|
|
This is the _characteristic equation_.
|
|
]
|
|
|
|
#example[
|
|
$
|
|
y'' + 5y' + 6y = 0
|
|
$
|
|
It is homogenous, so we find the characteristic equation.
|
|
|
|
$
|
|
r^2 + 5 r + 6 = 0 \
|
|
r = -2, -3 \
|
|
y_1 = e^(-2t), y_2 = e^(-3t)
|
|
$
|
|
]<particular-solutions>
|
|
|
|
#example[
|
|
$ y'' - 2y' + y = 0 $
|
|
The characteristic equation is
|
|
$
|
|
r^2 - 2r + 1 = 0 \
|
|
r = 1 \
|
|
y_1 = e^t
|
|
$
|
|
]
|
|
|
|
== Superposition principle for 2nd order linear homogenous ODE
|
|
|
|
We can find a few particular solutions to our ODE, but how can we find all of the solutions?
|
|
|
|
#fact[
|
|
Suppose $y_1(t), y_2(t)$ are a pair of solutions of
|
|
$
|
|
y'' + p(t) y' + q(t) y = 0
|
|
$
|
|
Then the linear combination
|
|
$
|
|
c_1 y_1(t) + c_2 y_2(t)
|
|
$
|
|
is also a solution.
|
|
]<superposition-principle>
|
|
|
|
#proof[
|
|
$
|
|
(c_1 y_1(t) + c_2 y_2(t))'' + p(t) (c_1 y_1(t) + c_2 y_2(t))' + q(t)(c_1 y_1(t) + c_2 y_2(t)) \
|
|
= c_1 y_1'' + c_2 y_2'' + p(t)(c_1 y_1' + c_2 y_2') + g(t)(c_1 y_1 + c_2 y_2) \
|
|
= c_1 (y''_1 + p(t)y'_1 + q(t) y_1) + c_2 (y''_2 + p(t) y'_2 + q(t) y_2) \
|
|
= c_1 (0) + c_2(0) = 0
|
|
$
|
|
]
|
|
|
|
#example[Revisiting @particular-solutions][
|
|
$
|
|
y'' + 5y' + 6y = 0
|
|
$
|
|
It is homogenous, so we find the characteristic equation.
|
|
|
|
$
|
|
r^2 + 5 r + 6 = 0 \
|
|
r = -2, -3 \
|
|
y_1 = e^(-2t), y_2 = e^(-3t)
|
|
$
|
|
|
|
So by @superposition-principle,
|
|
$
|
|
y(t) = c_1 e^(-2t) + c_2 e^(-3t)
|
|
$
|
|
is a general solution.
|
|
]
|
|
|
|
#example[
|
|
Find the general solution of
|
|
$
|
|
y'' + 2y' - 3y = 0 \
|
|
y(1) = 1, y'(1) = -1
|
|
$
|
|
and then find the solution satisfying the initial conditions
|
|
$
|
|
y(1) = 1, y'(1) = -1
|
|
$
|
|
General solution is
|
|
$
|
|
y(t) &= c_1 e^(-3t) + c_2 e^t \
|
|
y'(t) &= -3 c_1 e^(-3t) + c_2 e^t
|
|
$
|
|
Now we need the particular solution.
|
|
$
|
|
1 &= c_1 e^(-3) + c_2 e \
|
|
-1 &= -3 c_1 e^(-3) + c_2 e \
|
|
$
|
|
|
|
Now we have a system and we can solve it using standard linear algebra
|
|
techniques.
|
|
]
|