Separable Differential Equations

So far we have seen how to solve first order differential equations when they are linear. If the equation is not directly integrable, we can multiply both sides by an integrating factor in order to write the equation in a form that can be directly integrated.

Non-linear equations are more complicated. In fact, not all nonlinear equations have an analytical solution. By this I mean that it is not always possible to find an expression for the state variable $y$ in terms of the independent variable $t$. This doesn't mean a solution doesn't exist. There is often still a solution to the differential equation, we just aren't able to find it. For example, the equation $$\frac{dy}{dt} + \sin(y) = \sin(t)$$ doesn't have a solution that we can express interms of elementary functions. However, we can still find an numerical approximation for solutions, which will be the topic of this week's lab.

There are a few categories of first order differential equations that we can solve. One example of these equations are separable differential equations.

Definition: A first order differential equation for $y(t)$ is separable if it can be written in the form $$\frac{dy}{dt} = f(t)g(y)$$ for some function $f(t)$ and $g(y)$.

Example: The differential equation $$\frac{dy}{dt} = \frac{\tan(t)}{y}$$ is separable with $f(t) = \tan(t)$ and $g(y) = 1/y.$

Practice: Which of the following differential equations are separable?

  1. $$\frac{dy}{dt} +ty= t$$
  2. $$\frac{dy}{dt} = 1 + \frac{y^2-t}{t}$$
  3. $$\frac{dy}{dt} = y(1-y)$$
  4. $$\frac{dy}{dt} = e^{t^2}+y^2$$

As long as $g(y) \ne 0$, we can solve separable equations by rewriting them as $$ \frac{1}{g(y)}\frac{dy}{dt} = f(t)$$ and integrating with respect to $t$. By making the substitution $u = y,~~du = \frac{dy}{dt}$, we get $$ \int \frac{1}{g(u)}du = \int f(t) dt.$$ As long as we are able to evaluate both integrals, we can find a family of solutions.

Example: Find a solution to the initial value problem: \begin{align}\frac{dy}{dt} &= \frac{\tan{t}}{y}, && y(0) = 1\end{align}

Solution: This is a separable equation with $f(t) = \tan{t}$ and $g(y) = 1/y.$ Therefore, \begin{align} y \frac{dy}{dt} &= \tan(t)\\ \int y \frac{dy}{dt} dt & = \int \frac{\sin(t)}{\cos(t)}dt && \text{let}~u = \cos{t},~~du=-\sin(t)dt\\ \int y dy &= \int \frac{-1}{u}du\\ \frac{1}{2}y^2 &= -\ln(u)+C && \text{sub } u = \cos{t}~\text{back in}\\ \frac{1}{2}y^2 &= -\ln(\cos{t})+C\\ y(t) &= \sqrt{2C-2\ln(\cos{t})}, \end{align} Which is defined and differentiable for $t$ in the interval $(-\pi/2,\pi/2)$

Example: Find a one parameter family of solutions to $$\frac{dy}{dt} = y(4-y),$$

This is a separable equation with $f(t) = 1$ and $g(y) = y(4-y).$ By separating, and integrating we get $$ \int \frac{1}{y(4-y)} \frac{dy}{dt} dt = \int 1 dt.$$ Canceling the $dt$s on the left hand side, and evaluating the right hand side leaves us with $$\int \frac{1}{y(4-y)}dy = t + C.$$ To solve the integral on the right hand side, we will want to re-write the integrand using a partial fraction decomposition. I.e. we want to write $$\frac{1}{y(4-y)} = \frac{A}{y}+\frac{B}{4-y}$$ for some constants $A$ and $B$. These constants can be found by multiplying through by $y(4-y)$, and then collecting like terms in $y$: \begin{align} 1 &= \frac{A}{y} y (4-y)+\frac{B}{4-y}y(4-y)\\ 1&= A(4-y) + B y\\ 1 +0\cdot y & = 4A +(B-A)y. \end{align} In order for this to be true for all values of $y$, the constant terms on the left must match the constant terms on the right, and the likewise for the $y$ terms. Therefore, we have $ A = 1/4$, $A = B = 1/4$, and $$\frac{1}{y(4-y)} = \frac{1}{4y}+\frac{1}{4(4-y)}$$

Going back to our differential equation, we have \begin{align} \int\frac{1}{y(4-y)}dy &= t+C\\ \int\frac{1}{4y}+\frac{1}{4(4-y)}dy &= t+C\\ \frac{1}{4}\ln\vert y \vert - \frac{1}{4}\ln \vert 4-y \vert &= t+C. \end{align} Solving for $y$ gives \begin{align} \frac{y}{4-y} &= e^{4t+C} = e^{4t}e^C && \text{let}~\widetilde{C} = e^C\\ y &= \widetilde{C}e^{4t}(4-y)\\ y + \widetilde{C}e^{4t}y &= 4\widetilde{C}e^{4t}\\ y &= \frac{4\widetilde{C}e^{4t}}{1+\widetilde{C}e^{4t}.} \end{align} Which is a defined and differentiable for all $t\in (-\infty,\infty).$

Exercises

Find a one parameter family of solutions for each differential equation

  1. $$ \frac{dy}{dt} = \frac{\sin(t)}{\sin(y)}$$
  2. $$\frac{dy}{dt} +ty = t$$
  3. $$\frac{dy}{dt} = \frac{y}{(t+1)(t-1)}$$
  4. $$ \frac{dy}{dt} = \frac{ty^2}{(t+2)(t+3)}$$