How do we solve a first-order differential equation when the variables separate?
Solve separable first-order differential equations of the form dxdy=f(x)g(y) by separating variables and integrating both sides
A focused answer to the HSC Maths Extension 1 dot point on separable differential equations. The separation-of-variables method, integration on both sides, applying initial conditions, and standard models including Newton's law of cooling, with worked examples.
✦ Generated by Claude Opus 4.8·12 min answer·
Reviewed by: AI editorial process; not yet individually human-reviewed
NESA wants you to solve a first-order differential equation of the form dxdy=f(x)g(y) by separating the variables, integrating each side, and applying any given initial condition to find the constant of integration.
The conceptual leap is that dxdy, though it is really a single limit, can be manipulated like a fraction here: you gather all the y-stuff with dy on one side and all the x-stuff with dx on the other, then integrate each side with respect to its own variable. This works precisely because the right-hand side factorises into a part in x times a part in y - which is what "separable" means.
The answer
The separation method
For an equation dxdy=f(x)g(y):
Rewrite as g(y)dy=f(x)dx.
Integrate both sides: ∫g(y)dy=∫f(x)dx+C.
Solve for y in terms of x (or leave in implicit form if cleaner).
Apply any initial condition y(x0)=y0 to determine C.
If g(y0)=0 for some value y0, then y=y0 is a constant solution (an equilibrium of the equation). This must be checked separately, because the separation step divides by g(y) and so silently throws it away.
Reading the equation geometrically, stage by stage
A first-order ODE assigns a gradient to every point of the plane, and a solution is a curve that follows those gradients. Seeing this picture makes the algebra meaningful: separating and integrating is just finding the curves that thread through the gradient field. The figures below use dxdy=−yx, whose solutions turn out to be circles.
Stage 1, the slope field. The equation gives a slope at every point: at (x,y) the gradient is −yx. Drawing a short segment of that slope at a grid of points produces the slope field, which already hints at a circular pattern.
Stage 2, separate and integrate. Gather the variables: ydy=−xdx. Integrating both sides gives 21y2=−21x2+C, which tidies to x2+y2=C. The algebra has produced the equation of the curves the slope field was tracing.
Stage 3, the general solution.x2+y2=C is a family of concentric circles, one for each value of the constant C>0. Every member of the family is a solution; the slope-field segments are tangent to these circles, which is the visual meaning of "the curve follows the gradients".
Stage 4, apply the initial condition. A condition such as y=2 when x=0 fixes the constant: 0+4=C, so C=4. That selects the single circle x2+y2=4 from the family - the particular solution through the given point.
When separation is possible
A first-order ODE separates if and only if you can write dxdy=f(x)g(y) for some functions f and g. Examples that separate:
dxdy=xy.
dxdy=exsiny.
dxdy=x−1y+1.
Examples that do not separate:
dxdy=x+y (a sum, not a product).
dxdy=x+yy (cannot be factored cleanly).
Extension 1 problems are always separable; non-separable equations belong to Extension 2.
The constant of integration
Always include a constant after integration. It is cleaner to combine the constants from both sides into one C on the right.
If the question gives an initial condition, substitute to find C. If not, leave the answer in terms of C. A favourite simplification is to relabel a messy constant: after exponentiating ln∣y∣=x3+C, the factor eC becomes a single new constant A, and you should say so explicitly.
Newton's law of cooling
A body cools toward an ambient temperature Ta at a rate proportional to the temperature difference:
dtdT=−k(T−Ta),
where k>0.
Separate: T−TadT=−kdt.
Integrate: ln∣T−Ta∣=−kt+C.
So T−Ta=Ae−kt for some constant A, giving
T(t)=Ta+(T0−Ta)e−kt.
The temperature approaches Ta as t→∞. Note that T=Ta is the equilibrium (constant) solution, the case A=0: a body already at room temperature stays there.
Implicit versus explicit solutions
Sometimes the integrated equation cannot be solved cleanly for y. In that case, leave it implicit. For example,
dxdy=−yx⟹ydy=−xdx⟹y2+x2=C.
This is the family of circles x2+y2=C, the implicit solution - and the one drawn in the stage figures above.
How exam questions ask about separable ODEs
"Solve the differential equation ..." (with an initial condition). Separate, integrate, apply the condition to find the constant, and give y explicitly (choosing the correct sign of any root from the initial condition).
"Find the general solution." Same, but stop at the family with +C; no initial condition is given.
"Show that y=… satisfies / is a solution." You can verify by differentiating, but a "solve" instruction wants the separation method shown.
"A body cools / a population grows ..." A modelling problem: set up the proportionality as a differential equation, separate and solve, then use the data points to find the constants k and A.
"Find the constant solution / equilibrium." Set dxdy=0, i.e. solve g(y)=0; this is the solution the separation step hides.
"Leave your answer in implicit form." Do not force an explicit y; the integrated equation is the answer.
Exam-style practice questions
Practice questions written in the style of NESA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
2023 HSC Q124 marksSolve the differential equation dxdy=yx with y(0)=2.
Show worked answer →
Separate variables: ydy=xdx.
Integrate both sides: 2y2=2x2+C, so y2=x2+C′ (writing C′ for 2C).
Apply y(0)=2: 4=0+C′, so C′=4.
y2=x2+4, so y=x2+4 (positive root because y(0)=2>0 and continuity).
Markers reward the separation, the integration on both sides, applying the initial condition to find the constant, and choosing the correct sign for the square root.