ODEs· Note 01

Introduction

Year 2 · Semester IILast updated

May 2 Lecture

What is an ODE?

An ODE (ordinary differential equation) is an equation which connects a function y(x)y(x) with its derivative(s) and with xx.

Example of an ODE
y′′−3xy′+4y=x3y\pp-3xy\p+4y=x^3

A solution of an ODE is a function y(x)y(x) which satisfies the ODE.

Solutions of an ODE
y′=2y+3y\p=2y+3

Solutions to ODE

  1. Constant solution:
    If y(x)=ky(x)=k (a constant), then y′=0y\p=0.
y(x)=k0=2k+30=2k+3k=−1.5\begin{align*}y(x)&=k\\0&=2k+3\\0&=2k+3\\k&=-1.5\end{align*}
  1. Claim: y(x)=5e2x−32y(x)=5e^{2x}-\frac32 is a solution.
    Check:
y=5e2x−32y′=?2y+3(5e2x−32)′=10e2x10e2x=?2(5e2x−32)+3=✓10e2x\begin{align*}y&=5e^{2x}-\frac32\\y\p&\stackrel{?}{=}2y+3\\\\{\left(5e^{2x}-\frac32\right)}\p&=10e^{2x}\\10e^{2x}&\stackrel{?}{=}2\left(5e^{2x}-\frac32\right) + 3\stackrel{\checkmark}{=}10e^{2x}\end{align*}

Definition: Equilibrium Solution

A constant solution to an ODE is called an equilibrium solution

Definition: General Solution

The general solution of an ODE is the set of all solutions to the ODE, and usually can be expressed using one or two constants.

In the above example, the general solution is y(x)=Ce2x−32y(x)=Ce^{2x}-\frac32.

Defintion: Initial Condition

If we are given an initial condition (also called boundary condition) of the form y(a)=by(a)=b, there is only one specific solution which satisfies the ODE together with the initial condition.

A pair of an ODE with an Initial Condition is called an Initial-Value Problem.

Example of Initial Condition

ODE: y′=2x+3y\p=2x+3
Initial Condition: y(0)=7y(0)=7
General Solution of ODE is: y(x)=Ce2x−32y(x)=Ce^{2x}-\frac32 (as shown above)

Plug in boundary condition to find CC:

7=Ce0−327=C−328.5=C\begin{align*}7&=Ce^0-\frac32\\7&=C-\frac32\\8.5&=C\end{align*}

Solution: y(x)=8.5⋅e2x−32y(x)=8.5\cdot e^{2x}-\frac32

The order of an ODE is the number of the highest derivative of yy appearing in the ODE.

In general, the order of the ODE is also how many constants the general solution will contain, and also the number of initial conditions you need to arrive at a specific solution.

How to Solve the ODE y’=ky

y′=kyy\p=ky

where kk is a non-zero fixed constant.

Note that this ODE has an equilibrium solution: y(x)=0y(x)=0.

Otherwise (assuming y(x)≠0y(x)\not=0), divide by yy:

y′y=k\frac {y\p}y=k

Since y′y\frac {y\p}y is a derivative of ln⁡(y)\ln (y), take the integral of both sides:

∫y′ydx=∫k  dxln⁡∣y∣=kx+Celn⁡∣y∣=ekx+C∣y∣=ekx⋅eCNote eC is a positive constant∣y∣=Cekx(C>0)y=Cekx(C≠0)\begin{align} \int\frac {y\p}ydx&=\int k\;dx\\ \ln|y|&=kx+C\\ e^{\ln|y|}&=e^{kx+C}\\ |y|&=e^{kx}\cdot e^C\quad\text{Note $e^C$ is a positive constant}\\ |y|&=Ce^{kx}\quad(C>0)\\ y&=Ce^{kx}\quad(C\not=0) \end{align}

Including the equilibrium solution at y=0y=0, we get the general solution of the ODE y′=kyy\p=ky:

y=Cekx,  C∈Ry=Ce^{kx},\; C\in\R
Neat Trick

When integrating a term with y′y\p with respect to xx, you can pull out the y′y\p and integrate w.r.t. yy. For example, ∫y′ydx=∫1ydy\int\frac {y\p}ydx=\int \frac1ydy.

In general:

∫y′⋅f(y)dx=∫f(y)dy\int{y\p}\cdot f(y)dx=\int f(y)dy