Separation of Variables

Takeaways

  • Goal is to algebraically rearrange ODE to be in the form \(g(y)dy = h(x) dx\) then integrate both sides and solve for \(y\)
  • The ODE must be separable i.e. able to be put in this form in order to apply separation of variables. Non-separable ODEs cannot be solved via separation of variables
  • This method is only for first order ODEs (or an ODE that can be stated as a first order equation e.g. by making an appropriate substitution), but can be applied to any separable ODE (even nonlinear)
  • The hardest steps are in algebraically separating the equation and performing the integration, so make sure you are sharp in both of these areas

Overview

Separation of variables is both the simplest and the most difficult solution you will do this quarter. It is simple because the calculus is actually incredibly straight forward (you will only ever have to do one integral for all of these methods), but the difficult part is that this method is very open-ended i.e. there aren’t any “plug and chug” sorts of results or shortcuts we can give. Computationally this method is quite simple, but it takes a lot of facility with algebra to carry out accurately and efficiently.

The basic idea here is having a separable ODE. That is, we want to be able to put our ODE into the form

\[g(y)dy = h(x) dx\]

where we can just integrate both sides to arrive at a solution. Note that we are only actually doing one integral when carrying out this method, so naturally this means the method can only apply to first order ODEs. However, it doesn’t matter if the ODE is linear or nonlinear or homogeneous or inhomogeneous—the only condition for using separation of variables is separability of the ODE.

The main challenge in this method is arranging the ODE to be in this form. However, do not despair, we have a few main tools we use to do this. Namely, our toolbox consists of:

  1. Algebraic Manipulations
  2. Substitutions

Below, we outline these methods and give a few examples. However, please note that these are just examples, and separation of variables requires a lot of practice to recognize patterns in the ODE to make the appropriate manipulation or substitution. Unlike other solution methods in this course, there are no nice closed form results or shortcuts, so it is up to you to do most of the work to setup the problem so the method can be applied.

Algebraic Manipulations

The first and most important tool in separation of variables is algebraic manipulations. Essentially, you’ll be handed an ODE, and your job is to algebraically manipulate both sides to eventually get a separable equation. This is exactly what you’ve been doing since Calc I when you solved very simple ODEs. (Actually, separation of variables is exactly that same method, just in CME 102 we treat it a bit more rigorously and give you more advanced problems.)

You all know algebra, so we won’t spend too much time hammering this point. I will offer one example that’s a bit unintuitive. Quite often you will see ODEs of the form:

\[y' = f(x,y)\]

that have some sort of polynomial structure to the right hand side. An example would be:

\[y' = yx^2 +2xy + y + 5x^2 + 10x + 5\]

The right side looks kind of like a polynomial, so when you see something like this it is worth seeing if you can factor this into separable terms. A good first step is to group all of the \(y\) terms together: \(y' = y(x^2 + 2x + 1) + 5x^2 + 10x + 5\)

Now notice that I can factor the term \(x^2 + 2x + 1\) out of both terms. Doing this, I arrive at:

\[y' = (y+5)(x^2 + 2x + 1)\]

which is a separable ODE! So, by applying a clever algebraic manipulation, we were able to arrive at an ODE we can solve via separation of variables.

To finish the solution, we simply divide through and integrate:

\[\begin{align*} y' &= (y+5)(x^2 + 2x + 1) \\ \frac{dy}{y + 5} &= (x^2 + 2x + 1)dx \\ \ln (y + 5) &= \frac{1}{3}x^3 + x^2 + x + C \\ y &= Ce^{\frac{1}{3}x^3 + x^2 + x} -5 \quad \blacksquare \end{align*}\]

Substitution Method

The must more difficult type of separation of variables is the “substitution method”. However, it’s important to note that “substitution method” isn’t a separate method at all, it is just another way of doing separation of variables.

The substitution method is actually very similar to generalized coordinate transforms in CME 100. Indeed, they are actually the same method in principle—transform the problem into a different space where the integration is easier to carry out. In CME 100, this was to compute definite integrals; in CME 102, we are doing the transformation to make the ODE separable, and thus integrable.

Here, we will just walk through an example (similar to the one above) that employs a substitution to demonstrate the general idea. However, please keep in mind that the type of subsitution presented here is not by any means the only kind of subsistution out there (several others are given in the course reader and section worksheet), and the best way to improve with this method is just to practice with as many example problems as you can.

Consider the ODE:

\[y' = 5y^2 + 10xy + 5x^2\]

Once again, the right hand side has some sort of polynomial structure, so a good place to start is with trying to factor this side. First we can factor out \(5\) from this side:

\[y' = 5(y^2 + 2xy + x^2)\]

From here, notice that the right side is just \(5(y+x)^2\). This gives us:

\[y' = 5(y+x)^2\]

It may feel a bit awkward doing a factorization with \(x\) included like this, but this is perfectly valid to do and you should feel comfortable employing this kind of trick.

Now, we need to put it into a separable form. When you’re doing a substitution, the goal is not to manipulate the equation to be a separable form, but to manipulate the equation to be in a form where it becomes separable when I make a substitution. Here, if we can find some way to store \(y + x\) in one variable that I solve for, then we’ll be done. To do this, we naturally make the substitution:

\[u = y + x\]

and take the derivative:

\[u' = y' + 1\]

Now, using this substitution we have an ODE of the form:

\[u' - 1 = 5u^2\]

which after a bit of manipulation becomes:

\[\frac{1}{5u^2 + 1}du = dx\]

From here, we can integrate this to find: \(\begin{align*} \int \frac{1}{5u^2 + 1}du &= \int dx \\ \frac{1}{\sqrt{5}} \tan^{-1}(\sqrt{5}u) &= x + C \\ u(x) = \frac{1}{\sqrt{5}} \tan (\sqrt{5}x + C) \quad\blacksquare \end{align*}\)

and plugging back in to find \(y\) we have:

\[y = \frac{1}{\sqrt{5}} \tan (\sqrt{5}(y+x) + C) - x \quad \blacksquare\]

Notice that \(y\) appears on both sides of the equation and cannot be solved out for algebraically. This type of solution is called an implicit solution, since we cannot explicitly express \(y\).

Concluding Remarks

Separation of variables is a very powerful solution method—indeed, many of the methods for the rest of the quarter have some relation or basis in separation of variables—but leaves a lot of work to the user (you) to actually carry out the method. For algebraic manipulations, it is a matter of recognizing patterns in the ODE and using this to rearrange into separable form. For substitutions, you need to examine the ODE to find a term that appears in multiple places that you can substitute to make the solution tenable, and the challenge is picking the right substitution and applying it correctly. In the end, there aren’t any clean straight forward results, so the onus is on you, the student and mathematician, to apply the correct method and carry it out.