Notes@HKU by Jax

Orinary Differential Equations

First Order Differential Equations

Differential equations are equations that involve a function and its derivatives.

Order of differential equations

A n ordered differential equation is an equation of the form:

F(x,y,y′…yn′)=0F(x,y,y'\dots y'_n)=0

Where yn′y'_n is the nth derivative of yy with respect to xx. The highest degree of the derivative is n for a n-ordered differential equation. Note that yy is really just y(x)y(x) (A function of x)

Solving linear 1st-ODEs

Linear differential equations

Linear differential equations does not contain non-linear functions. (e.g. sin⁡y\sin y) Otherwise, it's a non-linear ODE.

Solving by integrating factors

We can solve a linear 1st-ODE as followed, given a particular solution of y(x)y(x):

y′+p(x)y=q(x):× e∫p(x)y'+p(x)y=q(x)\quad : \quad\times\ e^{\int p(x)}

The multiplied integration factor ep(x)e^{p(x)} will give us a product of the product rule, then we simply integrate both sides to solve for yy. Make sure that the coefficient of y′y' is 1.

g(y)}^{-1}dy & =f(x)dx \\

We can solve a separable equation as followed, given a particular solution of y(x)y(x):

dydx=f(x)g(y)∫g(y)−1 dy=∫f(x) dx⇐[(x,y)→c]\begin{aligned} \frac{dy}{dx} & =f(x)g(y) \\ \int{g(y)}^{-1}\:dy & =\int f(x)\:dx \Leftarrow [(x,y)\to c] \end{aligned}

Solving non-linear 1st-ODEs

Bernoulli's equation

A non-linear 1st-ODE of the form can be solved by:

y′+p(x)y=q(x)ynn∈R:sub u=y1−n→y,y′y'+p(x)y=q(x)y^n\quad n\in\mathbb{R}\quad : \quad \text{sub }u=y^{1-n}\to y,y'

The subsitution u=y1−nu=y^{1-n} will turn the equation into a linear ODE, then simply solve using integrating factors.

Riccati's equation

A non-linear 1st-ODE of the form can be solved by the following, given a particular solution of y(x)y(x):

y′=p(x)y2+q(x)y+r(x):sub y=y(x)+u−1y'=p(x)y^2+q(x)y+r(x)\quad : \quad \text{sub }y=y(x) + u^{-1}

Homogeneous equations

A homogeneous equation has it's xx and yy terms in the same degree. (e.g. x2+xy+y2=0x^2+xy+y^2=0)

A homogeneous 1st-ODE of the form can be solved by the following, given a particular solution of y(x)y(x):

y′=f(yx):sub u=yx→y′=u+xu′y'=f(\frac{y}{x})\quad : \quad \text{sub }u=\frac{y}{x} \to y'=u + xu'

We can divide the formula by xnx^n or yny^n to get the equation in the desired form (every term is the ratio yx\frac{y}{x}). Otherwise, we can shift the origin using X=x−nX=x-n and Y=y−mY=y-m.

After substitution, we will get a separable equation after the substitution, and the particular solution is used.

Exact equations

Partial derivatives

A partial derivative is a derivative of a function with respect to one of its variables, with the others held constant. The following notation expresses the partial derivative of ff with respect to xx:

∂f∂x\frac{\partial f}{\partial x}
F=2x+y∂F∂x=2\begin{aligned} F & =2x+y \\ \frac{\partial F}{\partial x} & =2 \\ \end{aligned}

Exact equations

An exact equation is simply a 1st-ODE where dF=0dF=0.

The expressed equation dFdF is exact if:

dF=Mdx+Ndy:∂M∂y=∂N∂xdF=Mdx+Ndy\quad:\quad\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}

Solving exact equations

To find the solution of an exact equation:

M=∂F∂x,N=∂F∂y∂F=M∂xF=∫Mdx+g(y)∂F∂y=N∂∫Mdx+g(y)∂y=N→g′(y)∫g′(y) dy=g(y)→F\begin{aligned} M=\frac{\partial F}{\partial x} & ,\quad N=\frac{\partial F}{\partial y} \\ \partial F & = M\partial x \\ F & = \int M dx + g(y) \\ \frac{\partial F}{\partial y} & = N \\ \frac{\partial \int M dx + g(y)}{\partial y} & = N \to g'(y) \\ \int g'(y)\:dy & = g(y) \to F \end{aligned}

g(y)g(y) is present as we are integrating partially with respect to xx, and g(y)g(y) is the constant of integration.

Hence, the solution would be:

∫Mdx+g(y)=c\int M dx + g(y)=c

Second Order Differential Equations

Solving homogeneous linear 2nd-ODEs

Constant coefficient Homogeneous 2nd-ODEs

The term homogeneous is used differently from the previous section.

A homogeneous 2nd-ODE is of the form:

ay′′+by′+cy=0ay''+by'+cy=\mathbf{0}

Where a,b,ca,b,c are constants. (Coefficients are constants)

We first use the following substitution:

ay′′+by′+cy=0:y=eλx  ⟹  aλ2+bλ+c=0→λay''+by'+cy=0:\quad y=e^{\lambda x}\implies a\lambda^2+b\lambda+c=0\to \lambda

To find the general solution, we put the λ\lambda roots into the quadratic characteristic equation:

  1. λ1≠λ2:y=c1eλ1x+c2eλ2x\lambda_1\ne\lambda_2:\quad y=c_1\mathbf{e}^{\lambda_1x}+c_2\mathbf{e}^{\lambda_2x}
  2. λ1=λ2:y=c1eλx+c2xeλx\lambda_1=\lambda_2:\quad y=c_1\mathbf{e}^{\lambda x}+c_2x\mathbf{e}^{\lambda x}
  3. {λ1,2=α±βi}∈C:y=c1eαxcos⁡(βx)+c2eαxsin⁡(βx)\{\lambda_{1,2}=\alpha\pm\beta i\}\in\mathbb{C}:\quad y=c_{1}\mathbf{e}^{\alpha x}\cos(\beta x)+c_{2}\mathbf{e}^{\alpha x}\sin(\beta x) If given particular solutions of yy and y′y', we can solve for c1c_1 and c2c_2 by finding y′y' with our general solution and substituting.

Cauchy-Euler equations

A Cauchy-Euler equation is a slight variation of homogenous 2nd-ODEs, which is of the following form and can be solved by:

ax2y′′+bxy′+cy=0:y=xλ  ⟹  a(λ2−λ)+bλ+c=0ax^2y''+bxy'+cy=0\quad:\quad y=x^\lambda\implies a(\lambda^2-\lambda)+b\lambda+c=0

The general solutions is similar to that of the homogeneous 2nd-ODEs, but with all terms of x→ln⁡xx\to \ln x:

  1. eλx→xλe^{\lambda x}\to x^\lambda
  2. eλx→xλ,x→ln⁡xe^{\lambda x}\to x^\lambda,\quad x\to \ln x
  3. eαx→xα,βx→βln⁡xe^{\alpha x}\to x^\alpha,\quad \beta x \to \beta \ln x

Solving non-homogeneous linear 2nd-ODEs

Constant coefficient Non-homogeneous 2nd-ODEs

A non-homogeneous 2nd-ODE is of the form:

F: ay′′+by′+cy=g(x)F:\ ay''+by'+cy=g(x)

Where a,b,ca,b,c are constants. (Coefficients are constants)

We first solve for λ1,2\lambda_{1,2} for the complementary homogenous function FcF_c to get YcY_c:

Fc: ay′′+by′+cy=0 →YcF_c:\ ay''+by'+cy=0\ \to Y_c

The general solution yy for the non-homogeneous 2nd-ODE FF is:

y=Yc+Ypy=Y_c+Y_p

Where YpY_p is a particular solution of yy. To solve for YpY_p, we can use the following methods:

Method of undetermined coefficients

To solve for YpY_p for a non-homogeneous 2nd-ODE, let YpY_p as the following if g(x)g(x) consists of:

  • eax→Yp=Aeaxe^{ax}\to Y_p=Ae^{ax}
  • sin⁡x and / or cos⁡x→Yp=Asin⁡x+Bcos⁡x\sin x\text{ and / or }\cos x\to Y_p=A\sin x+B\cos x
  • xn→Yp=Axn=Anxn+An−1xn−1+⋯+A0x^n\to Y_p=Ax^n=A_nx^n+A_{n-1}x^{n-1}+\dots+A_0 (polynomial of degree nn)

Important things to note:

▶\blacktriangleright If g(x)g(x) is a product of multiple components, YpY_p is the product of the different results.

▶\blacktriangleright If YpY_p consists of a non-constant term that exists in YcY_c, we must multiply YpY_p by xix^i and repeat the process.

We then substitute y=Yp→Fy=Y_p\to F and solve for AA and BB.

For Cachy-Eular equations, we instead multiply YpY_p by (ln⁡x)(\ln x) if YpY_p consists of a non-constant term that exists in YcY_c.

Variation of parameters

We can use this method when we are unable to see a particular solution for YpY_p in the above method.

Note that for YcY_c is in the form of c1y1+c2y2c_1y_1+c_2y_2. To solve for YpY_p for a non-homogeneous 2nd-ODE:

YP=−y1∫y2g(x)Wdx+y2∫y1g(x)Wdx,W=y1y2′−y2y1′Y_{P}=-y_1\int\frac{y_2g(x)}{W}dx+y_2\int\frac{y_1g(x)}{W}dx,\quad W=y_1y_2'-y_2y_1'

Note that for Cachy-Eular equations, g(x)g(x) is defined as the function with the coefficient of y′′y'' as 1, hence, g(x)→g(x)ax2g(x)\to \frac{g(x)}{ax^2}.

If YpY_p consists of a non-constant term that exists in YcY_c, we simply discard it (merging constants).

Solving ODEs with Laplace Transforms

Laplace transform

The Laplace transform is a technique used to solve linear ODEs with constant coefficients. The Laplace transform of a function f(t)f(t) is defined as:

L{f(t)}=∫0∞e−stf(t)dt=F(t)\mathcal{L}\{f(t)\}=\int_{0}^{\infty}e^{-st}f(t)dt=F(t)

Where ss is a complex number.

Properties of Laplace transforms

The following are some properties of Laplace transforms:

  • L{f+g}=L{f}+L{g}\mathcal{L}\{f+g\} = \mathcal{L}\{f\}+\mathcal{L}\{g\}
  • L{kf}=kL{f}\mathcal{L}\{kf\} = k\mathcal{L}\{f\}

Laplace transform of derivatives

The Laplace transform of the derivative of a function y(t)y(t) is:

L{y′}=sY(s)−y(0)L{y′′}=s2Y(s)−sy(0)−y′(0)\begin{aligned} \mathcal{L}\{y'\} & =sY(s)-y(0) \\ \mathcal{L}\{y''\} & =s^2Y(s)-sy(0)-y'(0) \end{aligned}

Where f(0)f(0) is the initial condition of ff.

ffL{f}\mathcal{L}\{f\}
0.aaas\frac{a}{s}
0.eate^{at}1s−a\frac{1}{s-a}
0.f∗gf*gF(s)G(s)F(s)G(s)
1.tnt^nn!sn+1\frac{n!}{s^{n+1}}
2.tnf(t)t^nf(t)(−1)ndndsnL{f(t)}(-1)^n\frac{d^n}{ds^n}\mathcal{L}\{f(t)\}
3.sin⁡at\sin atas2+a2\frac{a}{s^2+a^2}
4.cos⁡at\cos atss2+a2\frac{s}{s^2+a^2}
5.eatf(t)e^{at}f(t)F(s−a)F(s-a)
6.f(t−a)H(t−a)f(t-a)H(t-a)e−asL{f(t)}e^{-as}\mathcal{L}\{f(t)\}

Convolution operator:\ f∗g(t)=∫0tf(τ)g(t−τ) dτf*g(t)=\int_0^tf(\tau)g(t-\tau)\:d\tau

Inverse Laplace transform

The inverse Laplace transform is the reverse operation of the Laplace transform.

L−1{F(t)}=f(t)\mathcal{L}^{-1}\{F(t)\}=f(t)

You basically think backwards like how you'd do intergration sometimes. Remember to use the rules!

Partial fractions

A fraction can be decomposed into partial fractions if the degree of the numerator is less than the degree of the denominator. If not, then perform long division first.

  1. f(x)g(x)h(x)=Ag(x)+Bh(x)\frac{f(x)}{g(x)h(x)} = \frac{A}{g(x)} + \frac{B}{h(x)}
  2. f(x)g2(x)h(x)=Ag(x)+Bg2(x)+Ch(x)\frac{f(x)}{g^2(x)h(x)} = \frac{A}{g(x)} + \frac{B}{g^2(x)} + \frac{C}{h(x)}
  3. f(x)(x2+1)=Ax+Bx2+1\frac{f(x)}{(x^2+1)} = \frac{Ax+B}{x^2+1}

We can solve for AA, BB, and CC by multiplying the denominator (to make left side f(x)f(x) only) and solving for the numerator.

Solving ODEs with Laplace transforms

To solve a linear ODE with constant coefficients using Laplace transforms:

  1. Take the Laplace transform of both sides of ODE (y(t)→Y(s)y(t) \to Y(s))
  2. Solve for the Laplace transform of the function Y(s)Y(s)
  3. Convert Y(s)Y(s) into partial fractions
  4. Find the inverse Laplace transform of the function (Y(s)→y(t)Y(s)\to y(t))

On this page