Multivariate Calculus
&
Ordinary Differential Equations

Lecture 5



1 Ordinary Differential Equations

1.4 Separable ODEs

Separable first-order ODEs are one of several classes of ODE we will study in MATH1052.

It is very important that you become skilled at identifying and solving this type of ODE. See also Stewart, Section 9.3.





1 Ordinary Differential Equations

1.4.1 Definition

A first-order ODE is called separable if it can be written in the form

$\ds \dif{y}{x} = f(x)g(y).$






1 Ordinary Differential Equations

1.4.1 Definition

Exercise: Which of the following ODEs are separable?

  • $\displaystyle{\dif{y}{t}=y(1-y)},$
  • $\displaystyle{\dif{y}{x}=e^{x+y}},$
  • $\displaystyle{y'=e^{(x+y)^2}},$
  • $\displaystyle{\dot{y}=\dfrac{ty+y}{t^2}},$
  • $\displaystyle{\dif{y}{t}=ty+y^2}.$


1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

  1. Rewrite the equation as $\,\displaystyle \frac{1}{g(y)}\,\dif{y}{x} = f(x).$
  2. Integrate both sides with respect to $x$: $\,\displaystyle \int\frac{1}{g(y)}\,\dif{y}{x}\, \dup x = \int f(x) \dup x.$
  3. Note the integral on the left is a "substitution", so that we can replace the last equation by $\;\displaystyle \int\frac{\dup y}{g(y)} = \int f(x) \dup x. $
  4. If one is lucky (or very smart, or both) one or both of the integrals can actually be evaluated.
  5. If one is even more lucky (or even smarter) one can then finally explicitly express $y$ as a function of $x$.


1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

Important remark: The final two steps will not always be possible. Whenever you are asked to solve a separable ODE or IVP in this course you are supposed to always "go as far as possible". For good reasons we assume you are infinitely smart; not being able to compute simple integrals is never a valid excuse.

For the IVP $y'(x)=f(x) g(y),$ $y(x_0)=y_0$, we again might have the problem that we can't evaluate one of both of the integrals needed to solve the separable ODE. In this case, we can still write down an actual solution, be it a rather implicit one. Indeed, the solution to the IVP is given by \[ \int_{y_0}^y\frac{\dup t}{g(t)} = \int_{x_0}^x f(t) \dup t. \]



1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

Example: Solve the ODE $\;\ds \dif{y}{x}=\frac{x}{y}$.

$\ds \frac{dy}{dx} = x\left(\frac{1}{y}\right)$

$\Ra $ separable.

       😃




1. $\ds y \frac{dy}{dx} = x$

2. $\ds \int y \frac{dy}{dx} ~dx= \int x ~dx$

3. $\ds \int y ~dy = \int x~dx $

4. $\ds \frac{y^2}{2}= \frac{x^2}{2}+C $ $\Ra y = \pm \sqrt{x^2+ K} $   📝



1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

The solution we found for the above example contains an arbitrary constant so is the general solution. In the case of an IVP this constant will be fixed to find one, particular solution.

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{x}{y}},$ $\, y(0)=3.$





1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{x}{y}},$ $\, y(0)=3.$

We know that $y^2 = x^2 + K$ is the general solution. Consider the initial condition $y(0)=3.$

That is $\,3^2=0^2+ K$ $\Ra K = 9\,$ $\,\Ra y = \pm \sqrt{x^2+9}.$

Here we need to take the $+$ sign since $y(0)=3.$

So $y = \sqrt{x^2+9}$ is the solution to the IVP.



1 Ordinary Differential Equations

1.4.2 Solving separable ODEs


Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{\sin x}{y}},$ $\,y(0)=1.$







1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{\sin x}{y}},$ $\,y(0)=1.$

First, note that the ODE is separable!

    😃




1. $\ds y \frac{dy}{dx} = \sin x$

2. $\ds \int y \frac{dy}{dx} ~dx= \int \sin x ~dx$

3. $\ds \int y ~dy = \int \sin x~dx $

4. $\ds \frac{y^2}{2}= - \cos x+C $



1 Ordinary Differential Equations

1.4.2 Solving separable ODEs

Example: Solve the IVP $\;\displaystyle{\dif{y}{x}=\frac{\sin x}{y}},$ $\,y(0)=1.$

4. (cont.) Since $y(0)=1,$

$\Ra \dfrac{1^2}{2} = - \cos (0) + C$

$\Ra C = \dfrac{3}{2}$

$\Ra \dfrac{y^2}{2} = - \cos x + \dfrac{3}{2}.$

5. $\ds y = \pm \sqrt{3- 2 \cos x}$

    $\ds y = \sqrt{3- 2 \cos x}$






1 Ordinary Differential Equations

1.4.3 Singular solutions

In step 1 of our recipe for solving separable ODEs we rewrote $y'(x)=f(x)g(y)$ as \[ \frac{1}{g(y)}\,\dif{y}{x} = f(x). \] Since we can't divide by zero, this means that our method is only valid provided $g(y)\neq 0.$



1 Ordinary Differential Equations

1.4.3 Singular solutions

If there is an $a$ such that $g(a)=0$ then the ODE will have the equilibrium solution $y(x)=a.$ This is easy to check:

$\ds \frac{dy}{dx} = f(x)g(y).\,$ If $g(a)=0,$ then $\ds \frac{dy}{dx} = f(x)\cdot 0$ $=0$

$\qquad \Ra y=a $ is a solution.





1 Ordinary Differential Equations

1.4.3 Singular solutions

Such a solution is also known as a singular solution because it won't generally arise from our earlier recipe. Whenever you are asked to solve a separable ODE you will have to check for singular/equilibrium solutions.

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$.

This corresponds to the logistic equation




1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

This ODE is separable. 😃

The singular solutions are $y = 0$ and $y=1.$

1. Rewrite the equation: $\ds \frac{1}{y(1-y)}\frac{dy}{dt} = 1.$





1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

2. $\,\ds \frac{1}{y(1-y)}\frac{dy}{dt} = 1$ $\,\Ra \ds \int \frac{1}{y(1-y)}\frac{dy}{dt}~dt = \int dt$


3. $\, \ds \int \frac{1}{y(1-y)}dy = \int dt$




1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

3. $\, \ds \int \frac{1}{y(1-y)}dy = \int dt$

Partial fractions: $\,\ds \frac{1}{y(1-y)} = \frac{A}{y} + \frac{B}{1-y} $

$ \,\Ra \ds 1 =A (1-y)+ By.$

Let $y=0,$ $\, \Ra 1 = A(1)+B(0)$ $\, \Ra A=1.$

Let $y=1,$ $\, \Ra 1 = A(0)+B(1)$ $\, \Ra B=1.$




1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

3. $\, \ds \int \frac{1}{y(1-y)}dy = \int dt$

Since $\,A=1\,$ and $\,B=1,$

$\,\ds \frac{1}{y(1-y)} = \frac{A}{y} + \frac{B}{1-y} $ $ \ds \,= \frac{1}{y} + \frac{1}{1-y} $






1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

3. $\, \ds \int \frac{1}{y(1-y)}dy = \int dt$

Then we have that

$ \ds \, \int \frac{1}{y(1-y)}~dy$ $ \ds = \int \frac{1}{y}dy + \int \frac{1}{1-y}dy$ $ \ds = \int dt$

4. $ \,\Ra \ds \ln \abs{y} - \ln \abs{1-y}= t+C$

$\,\Ra \ds \ln\abs{\frac{y}{1-y}} = t+C$




1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

4. $ \,\Ra \ds \ln\abs{\frac{y}{1-y}} = t+C$

$\Ra \ds \abs{\frac{y}{1-y}} = e^{t+C}$ $\,= \ds e^t\cdot e^C$ $\; \Ra \ds \frac{y}{1-y} = \pm \,e^C\cdot e^t$

$ \Ra \ds \frac{y}{1-y} = A e ^t,$ where $\, A= \pm e^C.$



1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

👉 $\; \ds \frac{y}{1-y} = A e ^t$ $\, \Ra y = (1-y)A e^t$ $ = A e^t- Aye^t$

$\quad\ds\Ra y+ yAe^t = A e ^t$ $\, \Ra y\left(1+A e^t\right)= Ae^t$

$ \quad \Ra y= \dfrac{Ae^t}{1+A e^t}.$ Now we just need to find $A.$




1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

👉 $\; \ds \frac{y}{1-y} = A e ^t\,$ and $\, y= \dfrac{Ae^t}{1+A e^t}$

For $y(0) = y_0,\,$ then $\, \ds \frac{y_0}{1-y_0} = A e ^0 $ $= A.$

Thus $y= \dfrac{Ae^t}{1+A e^t}$ $= \dfrac{ \dfrac{y_0}{1-y_0}e^t}{1+ \dfrac{y_0}{1-y_0} e^t}$ $= \dfrac{y_0 e^t}{1-y_0+ y_0e^t}.$ 📝



1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve the IVP $\displaystyle \dif{y}{t} = y(1-y),$ $\,y(0)=y_0$. (logistic equation)

Therefore, the solution of the IVP is $$y= \dfrac{y_0 e^t}{1-y_0+ y_0e^t}.$$

The logistic equation has many uses in population dynamics, physical science and economics.



1 Ordinary Differential Equations

1.4.3 Singular solutions

Example: Solve $\;\ds\dif{y}{x}=y^2$.

Try it! 📝







1 Ordinary Differential Equations

1.4.4 Main points

  • You should be able to identify a first-order separable ODE.
  • You should know how to solve a separable ODE.
  • You should understand that equilibrium and singular solutions are equivalent and must be checked for when solving a separable ODE.



Credits