Separable differential equations
In some ways these are the easiest differential equations to solve in theory, though in practice the final step (that of integrating) may be difficult or impossible. A separable differential equation is one of the form:

 

\frac{dy}{dx}=\frac{f(x)}{g(y)}

 

where f(x) and g(y) are any functions of x and y respectively. For instance:

 

\frac{dy}{dx}=x y

 

is of this form where f(x)=x and f(y)=\frac{1}{y}. The reason that these equations are simple in theory is because we can rearrange them to be:

 

g(y)dy=f(x)dx

 

ie. we have all the x stuff on one side and all the y stuff on the other and then we can integrate both sides:

 

\int g(y)dy=\int f(x)dx

 

and that’s it. As long as you can do the integrals, you can get a function y in terms of x. let’s look at some examples:

 

\frac{dy}{dx}=x y

 

gives the following integral:

 

\int\frac{1}{y}dy=\int x dx

 

and so:

 

\ln |y|+c_1=\frac{x^2}{2}+c_2

 

here we have one constant of integration from each side of the interval, but because they are just constants, we can put them into one constant and call it c:

 

\ln |y|=\frac{x^2}{2}+c

 

we can then rearrange this to give:

 

|y|=e^{\frac{x^2}{2}+c}=e^ce^{\frac{x^2}{2}}

 

We can then call e^c just a constant, and let’s call it y_0 because we can see that when x is zero, |y| is just going to be given by this constant:

 

|y|=y_0e^{\frac{x^2}{2}}

 

This has two solutions (one where y is positive, and one where it is negative), so we can choose one of them, depending on the initial condition for y. If we are told that for x=0 y=3 then:

 

y=3e^{\frac{x^2}{2}}

 

If we are told that for x=0, y=-2 then:

 

y=-2e^{\frac{x^2}{2}}

 

so we have found the general set of solutions (and here, two particular solutions) to the initial differential equation.

Given that you can already integrate, basically that is all you need to know about solving separable differential equations, but let’s take another couple of examples:

 

\frac{dy}{dt}=\frac{4\sin 2t}{y}

 

given the initial condition that at t=0, y=1, ie. y(0)=1. We rearrange the equation to get the integral:

 

\int y dy=\int 4\sin 2t dt

 

This gives (taking the two integration constants and writing them as one:

 

\frac{y^2}{2}=-2\cos 2t+c

 

so y=\sqrt{c-4\cos 2t}, where we have absorbed a factor of 2 into c. Now we want to find the value of c given our initial condition, so we set t=0 and y=1:

 

1=\sqrt{c-4}

 

so c=5 and so the particular solution is:

 

y=\sqrt{5-4\cos 2t}

 

In the figure below we have plotted this solution, along with a number of solutions with other initial conditions.
figure:

Solutions to the differential equation \frac{dy}{dt}=\frac{4\sin 2t}{y} with different initial conditions (dashed lines) and with the particular initial condition y(0)=1 in the thick blue line.

Lets look at another example:

 

\frac{dy}{dx}=e^{-y}(2x-4)

 

with initial condition y(5)=0. Again, we rearrange the equation to be an integral:

 

\int e^ydy=\int 2x-4dx

 

and so e^y=x^2-4x+c giving the solution:

 

y=\ln\left(x^2-4x+c\right)

 

we plug in x=5 and y=0 to get:

 

0=\ln\left(5^2-4\times 5+c\right)

 

which is solved by c=-4. So the particular solution that we are interested in is:

 

y=\ln\left(x^2-4x-4\right)

 

Note that this only makes sense for x^2-4x-4>0 which has two solutions: 2+2\sqrt{2}<x and x<2-2\sqrt{2}. Only the first of these contains the point x=5 and so this is the branch that we are interested in, so the solution is given above and is valid for 2+2\sqrt{2}<x. The particular solution along with several other solutions are shown here:

Solutions to the differential equation \frac{dy}{dx}=e^{-y}(2x-4) with different initial conditions (dashed lines) and with the particular initial condition y(5)=0 in the thick blue line. The thick red line has the same value of c as the particular solution we are interested in, but it is disjoint from that solution as it never reaches x=5.

How does the integration tie in with Euler’s method. Well, in Euler’s method we are slowly adding up more and more change as we move along the x direction and it is telling us the total y that we have got to at any one value of x. Integration is just adding up and so Euler’s method is just the adding up of the little bits in discrete steps rather than as a continual function as in an interval.

Reminder: A way of thinking about these equation

 

Differential equations seem a bit mysterious at first, but we really can take them as extensions of algebraic equations. When you are given the equation:

 

x^2=x+4

 

You are being asked to find that number (or those numbers) whose square is equal to 4 plus itself. Similarly when you are given then differential equation:

 

\frac{dy}{dx}=x^2+y

 

You are being asked to find the family of functions y whose gradients are equal to their value plus the square of the x value at any one point. You should be able to go anywhere on one of these curves and the relationship between x, y and the gradient of the line at that point should satisfy the equation. How do you know that it does? Well, just plug in the function you believe to be a solution into the differential equation and if it does indeed give you zero then you’ve found a solution.

How clear is this post?