Separable ODEs

concept
Separable ODEs are some of the simplest to solve for and don't require any new skills you haven't used before. As such they are a perfect, gentle introduction into the world of ODE solving.
fact
A separable ODE is one where it can be written in the following form: $$f(x)dx = g(y)dy$$ In other words, everything with one variable can be placed on one side of the equals sign and everything with the other variable can be placed on the other side.
example

Determine whether the following are separable ODEs:

  1. \(\frac{dy}{dx} = x^2\)
  2. \(x^2ydy = y^2dx\)
  3. \(\frac{dy}{dx} = x^y\)

  1. We can rewrite this one as \(dy = x^2dx\) so it is separable.
  2. Dividing both sides by \(x^2y^2\) gives us \(\frac{1}{y}dy = \frac{1}{x^2}dx\) which is separated so it is separable.
  3. This one can't be rearranged into a separable form. No matter what we do we can't place all the \(x\)s on one side and all the \(y\)s on the other. So this one is NOT separable.
fact
Solving a separable ODE is simple. We place it in its separated form and then integrate both sides to get a solution.
example

Solve \(\frac{dy}{dx} = x^2\)

Placing it in separable form we get \(dy = x^2dx\). Now we integrate both sides: \(\int dy = \int x^2dx\) \(y = \frac{1}{3}x^3 + c\) We must ALWAYS remember that constant of integration. A solution to a differential equation is never one function, but a family of such functions differing by an additive constant.
example

Solve \(\frac{dy}{dx} = y\)

Rearrange to get \(\frac{1}{y}dy = dx\) and integrate both sides: \(\int \frac{1}{y}dy = \int dx\) \(\log(y) = x + c\) Exponentiate both sides to get a nicer answer: \(y = e^{x + c}\) Which can be simplified by letting \(e^c = A\): \(y = Ae^x\) This simplification is very common in ODEs as exponentials are everywhere.
example

Solve \(x\frac{dy}{dx} = y\)

\(\frac{1}{y}dy = \frac{1}{x}dx\) \(\int \frac{1}{y}dy = \int \frac{1}{x}dx\) \(\log(y) = \log(x) + c\) Raise \(e\) to both sides: \(y = e^{\log(x) + c} = Ax\) where \(A = e^c\)
example

Solve \(y' = e^{-y}(2x - 4)\)

This one looks a little more complicated than the others but works the same. Remember that \(y' = \frac{dy}{dx}\). \(e^ydy = (2x-4)dx\) \(\int e^ydy = \int (2x - 4)dx\) \(e^y = x^2 - 4x + c\) We won't always get our answer in the form \(y = f(x)\), although we could in this case it isn't necessary.
practice problems