Separable Differential Equations — Theory
1. What “separable” means
A first-order differential equation is called separable if it can be written as:
\[
\frac{dy}{dx}=f(x)g(y).
\]
This means that the \(x\)-part and the \(y\)-part appear as a product.
The method works because we can move all \(y\)-terms to one side and all \(x\)-terms to the other side.
Examples:
\[
y'=xy,\qquad
y'=x\sin(y),\qquad
y'=e^x y^2.
\]
2. Separation of variables
Starting from
\[
\frac{dy}{dx}=f(x)g(y),
\]
divide by \(g(y)\) and multiply by \(dx\):
\[
\frac{1}{g(y)}\,dy=f(x)\,dx.
\]
This step is called separating variables.
Important note: if \(g(y)=0\) for some value \(y=y_e\), then \(y(x)=y_e\) may be an equilibrium solution.
3. Integrating both sides
After separating variables, integrate both sides:
\[
\int \frac{1}{g(y)}\,dy
=
\int f(x)\,dx+C.
\]
The result may be an explicit solution or an implicit solution.
An explicit solution has the form:
\[
y=y(x).
\]
An implicit solution has \(x\) and \(y\) mixed together in one equation.
4. Using an initial condition
If an initial condition is given,
\[
y(x_0)=y_0,
\]
then the constant \(C\) is determined by the starting point.
A clean way to write the IVP solution is:
\[
\int_{y_0}^{y(x)}
\frac{1}{g(s)}\,ds
=
\int_{x_0}^{x}
f(t)\,dt.
\]
This definite-integral form automatically includes the initial condition.
5. Worked example: \(y'=xy,\ y(0)=1\)
Here:
\[
f(x)=x,\qquad g(y)=y.
\]
Separate variables:
\[
\frac{1}{y}\,dy=x\,dx.
\]
Integrate:
\[
\ln|y|=\frac{x^2}{2}+C.
\]
Exponentiate:
\[
y=Ce^{x^2/2}.
\]
Apply \(y(0)=1\):
\[
1=Ce^0
\quad\Longrightarrow\quad
C=1.
\]
Therefore:
\[
y=e^{x^2/2}.
\]
6. Equilibrium solutions
In a separable equation
\[
\frac{dy}{dx}=f(x)g(y),
\]
if
\[
g(y_e)=0,
\]
then
\[
y(x)=y_e
\]
is a constant solution.
These are called equilibrium solutions. They appear as horizontal solution curves.
7. Example: exponential growth and decay
The equation
\[
y'=ky
\]
is separable:
\[
\frac{1}{y}\,dy=k\,dx.
\]
Integrating gives:
\[
\ln|y|=kx+C.
\]
Therefore:
\[
y=Ce^{kx}.
\]
If \(k>0\), the solution grows. If \(k<0\), the solution decays.
8. Example: power-law separable equation
Consider:
\[
y'=xy^2.
\]
Separate variables:
\[
y^{-2}\,dy=x\,dx.
\]
Integrate:
\[
-\frac{1}{y}=\frac{x^2}{2}+C.
\]
This equation can be solved for \(y\), but the solution may have a vertical blow-up for some initial conditions.
9. Slope fields and solution curves
A slope field shows the slope
\[
\frac{dy}{dx}=f(x)g(y)
\]
at many points in the \(xy\)-plane.
A solution curve follows these small slope marks.
For an initial condition \(y(x_0)=y_0\), only one solution curve passes through the initial point,
as long as the right-hand side is sufficiently smooth near the point.
10. Numerical solution preview
Some separable equations cannot be solved explicitly in a simple way.
In those cases, the implicit solution still defines the curve, and numerical methods can approximate it.
A common method is the fourth-order Runge–Kutta method, abbreviated RK4.
It approximates the solution step by step:
\[
y_{n+1}
=
y_n
+
\frac{h}{6}
\left(k_1+2k_2+2k_3+k_4\right).
\]
This is used to draw a smooth solution curve and estimate values such as \(y(x^*)\).
12. Common mistakes
- Forgetting \(dy\) and \(dx\): write the separated equation carefully before integrating.
- Dividing by zero: when dividing by \(g(y)\), check whether \(g(y)=0\) gives equilibrium solutions.
- Dropping the absolute value: \(\int \frac{1}{y}\,dy=\ln|y|\), not just \(\ln y\).
- Forgetting the constant: indefinite integration requires \(+C\).
- Using the wrong initial condition: substitute \(x=x_0\) and \(y=y_0\), not just \(x=0\).
- Expecting every answer to be explicit: some separable equations are easier to leave implicit.
- Trusting a graph outside its valid interval: solutions may blow up or become undefined.