Differential equations/Separable differential equations

The order of a differential equation is the largest derivative involved. For example, in the equation $$\frac{d^2y}{dx^2} + \frac{dy}{dx} + y = 0$$, the largest derivative is the second, so the order is 2.

Separable Equations
One of the easiest class of ODEs to solve is separable equations.

Definition
A differential equation is called separable when it can be manipulated into an equation with the dependent variable and its differentials on one side of the equality, and the independent variable and its differentials on the other side. Thus, each side is in terms of a single variable.

Example
The equation $$\frac{dy}{dx} = y$$ has a fairly obvious solution if you know your differentiation rules well. Recall that $$\frac{d}{dx}e^x = e^x$$ and hence $$y=e^x$$ is a solution. But how could we have found this if we did not remember that $$e^x$$ happened to be its own derivative? Additionally, is it possible to find any more solutions? Observe that the equation above is separable, and can be written as $$\frac{1}{y}dy = dx$$. Now that both sides are in terms of their own variable, we can integrate:

$$\int\frac{1}{y}dy = \log{|y|} + C_1 = x +C_2 = \int dx$$

And thus, $$|y| = e^{x+C_2 - C_1} = e^x e^{C_2 - C_1} = Ae^x$$. Since $$C_1$$ and $$C_2$$ are arbitrary constants of integration, $$A = e^{C_2-C_1}$$ is another arbitrary constant, so that the final solution is $$y = Ae^x$$ for any $$A$$.

General Solution
Suppose we have some separable equation:

$$f(y)dy = g(x)dx$$

Then we can integrate both sides:

$$F(y) + C_1 = G(x) + C_2$$

Since the constants are arbitrary, we really only need one. However, do not forget the constant of integration, or you will lose a large number of solutions. Additionally, do not wait until the last step to add the constant of integration. Many times when learning calculus, students add a $$+C$$ to the end of a problem without really thinking, but remember that the $$C$$ comes from the integration, so you need to add it at that step. In the above example, adding the $$C$$ at the last step would give $$y = e^x + C$$ as a solution. But we can see that, for example, $$\frac{d}{dx}(e^x + 1) = e^x \neq e^x + 1$$, so that $$e^x + C$$ is not a solution (whenever $$C\neq 0$$)! At any rate, the equation is now of the form $$ F(y) = G(x) + C$$, which can be solved for $$y$$ using any available algebra tools.

In short:
 * 1) If possible, manipulate the equation using algebra to get each variable on its own side of the equation. The form should be $$f(y) dy = g(x) dx$$.
 * 2) Integrate both sides of the equation. Include a constant of integration.
 * 3) Solve for the function in terms of the independent variable.

It can be misleading, however, to think that a constant of integration necessarily must appear in the solution of a differential equation. This is true for linear equations, but for nonlinear ones, all bets are off.

Consider for example the equation


 * $$|y'| + |y| = 0$$.

The only solution to this equation is $$y = 0$$, and no arbitrary constant of integration can be imposed anywhere.