Separation of variables
Master separation of variables for Year 12 Specialist Mathematics in Queensland (QCAA). This is the standard method for solving a separable first-order differential equation \(-\) one whose slope \(\dfrac{dy}{dx}\) is a function of \(x\) times a function of \(y\) \(-\) by collecting the variables on opposite sides and integrating.
You will learn to separate the variables, integrate both sides with a single constant, make \(y\) the subject, and use an initial condition to turn a general solution into a particular solution \(-\) the groundwork for modelling growth, decay and cooling later in Unit 4.
Theory
Separation of variables is the method for solving a separable first-order differential equation \(\dfrac{dy}{dx}=f(x)g(y)\) in Year 12 Specialist Mathematics (QCAA, Queensland). Collect every \(y\) on one side and every \(x\) on the other, integrate both sides, and add one constant. This page shows how to reach the general solution and how an initial condition picks out a particular solution.
A first-order differential equation is separable when its right-hand side factors into a function of \(x\) alone times a function of \(y\) alone: \(\dfrac{dy}{dx}=f(x)g(y)\). Many Unit 4 equations \(-\) \(xy\), \(\dfrac{y}{x}\), \(x(1+y^2)\), \(y\cos x\), \(e^{x-y}\) \(-\) are of exactly this shape.
Separation of variables treats \(\dfrac{dy}{dx}\) as a ratio of differentials: divide by \(g(y)\) and multiply by \(dx\) so that each side holds a single variable, then integrate. Symbolically, \(\displaystyle\int\dfrac{1}{g(y)}\,dy=\int f(x)\,dx\).
Integrating both sides introduces a single constant of integration. The result, with the constant left arbitrary, is the general solution \(-\) a whole family of curves. Where possible you then make \(y\) the subject.
A particular solution is the one member of that family satisfying a given initial condition \((x_0,y_0)\). Substitute the condition to fix the constant, giving a single curve through that point.
A separable first-order differential equation has the form:
Separate the variables and integrate both sides (a single constant \(c\) covers both integrals):
Writing the anti-derivatives as \(G(y)\) and \(F(x)\), the general solution is:
For a particular solution, substitute the initial condition \((x_0,y_0)\) to find \(c\):
How to solve by separation of variables
- Separate: rearrange \(\dfrac{dy}{dx}=f(x)g(y)\) so every \(y\) (with \(dy\)) is on the left and every \(x\) (with \(dx\)) is on the right: \(\dfrac{1}{g(y)}\,dy=f(x)\,dx\).
- Integrate both sides, adding a single constant \(c\) on the \(x\)-side.
- Make \(y\) the subject where possible (exponentiate to clear a \(\ln\), take a square root, apply \(\tan\)) to write the general solution.
- Apply the initial condition \((x_0,y_0)\), if given, to evaluate the constant and state the particular solution.
Separate by dividing by \(y\), then integrate both sides:
| \(\dfrac{dy}{dx}\) | \(=\) | \(4xy\) |
| \(\int \dfrac{1}{y}\,dy\) | \(=\) | \(\int 4x\,dx\) |
| \(\ln|y|\) | \(=\) | \(2x^2+c\) |
Exponentiate to make \(y\) the subject; \(e^{c}\) becomes a constant \(A\):
| \(y\) | \(=\) | \(e^{2x^2+c}\) |
| \(y\) | \(=\) | \(Ae^{2x^2}\) |
The general solution is \(y=Ae^{2x^2}\).
Divide by \(y^2\) and integrate; \(\int y^{-2}\,dy=-\dfrac{1}{y}\):
| \(\dfrac{dy}{dx}\) | \(=\) | \(y^2\sin x\) |
| \(\int \dfrac{1}{y^2}\,dy\) | \(=\) | \(\int \sin x\,dx\) |
| \(-\dfrac{1}{y}\) | \(=\) | \(-\cos x+c\) |
Multiply by \(-1\) and take reciprocals (write \(C=-c\)):
| \(\dfrac{1}{y}\) | \(=\) | \(\cos x-c\) |
| \(y\) | \(=\) | \(\dfrac{1}{\cos x+C}\) |
The general solution is \(y=\dfrac{1}{\cos x+C}\).
Separate and integrate both sides:
| \(\dfrac{dy}{dx}\) | \(=\) | \(\dfrac{4x}{y}\) |
| \(\int y\,dy\) | \(=\) | \(\int 4x\,dx\) |
| \(\dfrac{y^2}{2}\) | \(=\) | \(2x^2+c\) |
Substitute \((1,3)\) to find \(c\), then solve for \(y\):
| \(\dfrac{3^2}{2}\) | \(=\) | \(2(1)^2+c\) |
| \(\dfrac{9}{2}\) | \(=\) | \(2+c\) |
| \(c\) | \(=\) | \(\dfrac{5}{2}\) |
| \(y^2\) | \(=\) | \(4x^2+5\) |
| \(y\) | \(=\) | \(\sqrt{4x^2+5}\) |
The particular solution is \(y=\sqrt{4x^2+5}\).
Write \(e^{x+y}=e^x e^y\), separate, and integrate both sides:
| \(\dfrac{dy}{dx}\) | \(=\) | \(e^x e^y\) |
| \(\int e^{-y}\,dy\) | \(=\) | \(\int e^x\,dx\) |
| \(-e^{-y}\) | \(=\) | \(e^x+c\) |
Apply \((0,0)\) to find \(c\), then make \(y\) the subject:
| \(-e^{0}\) | \(=\) | \(e^{0}+c\) |
| \(-1\) | \(=\) | \(1+c\) |
| \(c\) | \(=\) | \(-2\) |
| \(e^{-y}\) | \(=\) | \(2-e^x\) |
| \(y\) | \(=\) | \(-\ln(2-e^x)\) |
The particular solution is \(y=-\ln(2-e^x)\).
Common pitfalls
Frequently asked questions
What is separation of variables?
It is a method for solving a differential equation of the form \(\dfrac{dy}{dx}=f(x)g(y)\). You rearrange so all the \(y\) terms (with \(dy\)) are on one side and all the \(x\) terms (with \(dx\)) on the other, then integrate both sides.
When can I use separation of variables?
Only when the right-hand side factorises into a function of \(x\) alone times a function of \(y\) alone. If \(\dfrac{dy}{dx}\) cannot be written as \(f(x)g(y)\) \(-\) for example \(\dfrac{dy}{dx}=x+y\) \(-\) the equation is not separable.
What is the difference between a general and a particular solution?
The general solution keeps the constant of integration arbitrary, so it describes a whole family of curves. A particular solution uses an initial condition \((x_0,y_0)\) to fix that constant, giving the single curve through that point.
Why is there only one constant of integration?
Integrating each side of a separated equation gives a constant, but the difference of two arbitrary constants is just one arbitrary constant. By convention you write a single \(+c\) on the \(x\)-side.
How do I deal with \(\ln|y|\) after integrating?
Exponentiate both sides. \(\ln|y|=F(x)+c\) becomes \(|y|=e^{F(x)+c}=e^{c}e^{F(x)}\), and \(e^{c}\) is a positive constant usually renamed \(A\), so \(y=Ae^{F(x)}\).
Do I need the modulus signs from \(\int\dfrac{1}{y}\,dy=\ln|y|\)?
Keep them while integrating. Once you exponentiate and introduce the constant \(A\) (which can be positive or negative), the constant absorbs the sign, so the final answer is written without the modulus.