Separation of Variables
Many differential equations can be solved by gathering each variable on its own side and integrating. This guide shows the method, where the constant goes, and what can be lost along the way.
A differential equation is separable if it can be written as \(\frac{dy}{dx} = g(x)\,h(y)\). Move everything with \(y\) to the left with \(dy\) and everything with \(x\) to the right with \(dx\): \(\frac{1}{h(y)}\,dy = g(x)\,dx\). Integrate both sides, add one constant \(C\), then solve for \(y\) if you can. The result is the general solution: a family of functions, one for each \(C\).
1When it works
| Equation | Separable? |
|---|---|
| \(\frac{dy}{dx} = xy\) | Yes: \(x \cdot y\) |
| \(\frac{dy}{dx} = \frac{x}{y}\) | Yes: \(x \cdot \frac1y\) |
| \(\frac{dy}{dx} = e^{x - y}\) | Yes: \(e^x \cdot e^{-y}\) |
| \(\frac{dy}{dx} = x + y\) | No: a sum cannot be split into a product |
2The method
\(\dfrac{dy}{dx} = xy\)
- 1Separate: put every \(y\) with \(dy\) and every \(x\) with \(dx\): \(\dfrac{1}{y}\,dy = x\,dx\).
- 2Integrate both sides: \(\ln|y| = \dfrac{x^2}{2} + C\). One constant is enough; it absorbs the constants from both sides.
- 3Solve for \(y\): \(|y| = e^{x^2/2 + C} = e^C e^{x^2/2}\). Write \(\pm e^C\) as a single constant \(C\).
“Separating variables, \(\frac{1}{y}\,dy = x\,dx\). Integrating both sides, \(\ln|y| = \frac{x^2}{2} + C\), so \(y = Ce^{x^2/2}\).”
\(\ln|y| + C_1 = \frac{x^2}{2} + C_2\) is correct but wasteful: subtracting gives one constant. Write a single \(C\) on one side.
From \(\ln|y| = \frac{x^2}{2} + C\), the next line is \(|y| = e^{x^2/2 + C} = e^Ce^{x^2/2}\), so the constant multiplies. Writing \(y = e^{x^2/2} + C\) is wrong.
\(\dfrac{dy}{dx} = \dfrac{x}{y}\)
- 1\(y\,dy = x\,dx\). Integrate: \(\dfrac{y^2}{2} = \dfrac{x^2}{2} + C\).
- 2Multiply by 2 and rename the constant: \(y^2 = x^2 + C\).
3Solving for y
\(\dfrac{dy}{dx} = y^2\)
- 1\(y^{-2}\,dy = dx\). Integrate: \(-y^{-1} = x + C\).
- 2Solve: \(y = -\dfrac{1}{x + C}\).
\(\dfrac{dy}{dx} = e^{x - y}\)
- 1Rewrite: \(e^{x - y} = e^x e^{-y}\). Then \(e^y\,dy = e^x\,dx\).
- 2Integrate: \(e^y = e^x + C\). Take ln: \(y = \ln(e^x + C)\).
\(\dfrac{dy}{dx} = 0.5(y - 4)\)
- 1Separate: \(\dfrac{1}{y - 4}\,dy = 0.5\,dx\).
- 2Integrate: \(\ln|y - 4| = 0.5x + C\).
- 3Exponentiate and rename the constant: \(y - 4 = Ce^{0.5x}\).
\(\dfrac{dy}{dx} = \dfrac{2x}{3y^2 + 1}\)
- 1Separate: \((3y^2 + 1)\,dy = 2x\,dx\).
- 2Integrate: \(y^3 + y = x^2 + C\).
- 3There is no simple formula for \(y\) from \(y^3 + y = \dots\), so stop here.
4What can go wrong
Dividing by \(y\) assumes \(y \neq 0\). But \(y = 0\) also satisfies \(\frac{dy}{dx} = xy\). It reappears as \(C = 0\) in \(y = Ce^{x^2/2}\); in other equations, check constant solutions separately.
Quick reference
| Step | Action |
|---|---|
| 1 | Write as \(\frac{dy}{dx} = g(x)h(y)\) |
| 2 | Separate: \(\frac{1}{h(y)}dy = g(x)dx\) |
| 3 | Integrate both sides; one + C |
| 4 | Solve for y; rename constants |
| 5 | Check for constant solutions lost by dividing |