Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Specialist (Unit 3 & 4) Rates of change and differential equations

Separation of variables

20 practice questions 0 video lessons Theory + worked examples

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.

Create a free accountTrack your progress and save your work as you go.
Create free account

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.

The separation of variables method A downward flow of three boxes. Box one: dy over dx equals f of x times g of y. An arrow labelled separate leads to box two: the integral of dy over g of y equals the integral of f of x dx. An arrow labelled integrate, add c leads to box three: G of y equals F of x plus c, then make y the subject. A final note: use an initial condition to fix c for a particular solution. \dydx = f(x)\,g(y) ∫ dy/g(y) = ∫ f(x) dx G(y) = F(x) + c separate integrate, + c make ​y the subject, then use ​(x₀,y₀) to fix ​c
The method: separate the variables, integrate both sides (one constant \(c\)), make \(y\) the subject, then use an initial condition to fix \(c\).
The general solution is a family of curves Axes with three curves of the form y equals A times e to the x squared over two, for A of one half, one and two. They share the same shape and never cross. The middle curve, through the point (0,1), is highlighted as the particular solution y equals e to the x squared over two. x y (0, 1) general: y = A e^(x²/2) particular: y = e^(x²/2)
The general solution \(y=Ae^{x^2/2}\) of \(\dfrac{dy}{dx}=xy\) is a family of curves; the condition \((0,1)\) selects the particular solution (gold).

A separable first-order differential equation has the form:

\[ \dfrac{dy}{dx}=f(x)\,g(y) \]
dydx=f(x)g(y)

Separate the variables and integrate both sides (a single constant \(c\) covers both integrals):

\[ \int \dfrac{1}{g(y)}\,dy=\int f(x)\,dx \]
1g(y)dy=f(x)dx

Writing the anti-derivatives as \(G(y)\) and \(F(x)\), the general solution is:

\[ G(y)=F(x)+c \]

For a particular solution, substitute the initial condition \((x_0,y_0)\) to find \(c\):

\[ c=G(y_0)-F(x_0) \]
One constant, added once. Integrate both sides but write a single \(+c\) on the \(x\)-side. When \(\ln|y|\) appears, exponentiating turns \(e^{c}\) into a new positive constant \(A\), so \(y=Ae^{\,\cdots}\).

How to solve by separation of variables

  1. 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\).
  2. Integrate both sides, adding a single constant \(c\) on the \(x\)-side.
  3. Make \(y\) the subject where possible (exponentiate to clear a \(\ln\), take a square root, apply \(\tan\)) to write the general solution.
  4. Apply the initial condition \((x_0,y_0)\), if given, to evaluate the constant and state the particular solution.
Example 1 — General solution (exponential)
Find the general solution of \(\dfrac{dy}{dx}=4xy\).
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}\).

Example 2 — General solution (reciprocal power)
Find the general solution of \(\dfrac{dy}{dx}=y^2\sin x\).
Solution

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}\).

Example 3 — Particular solution (initial condition)
A curve satisfies \(\dfrac{dy}{dx}=\dfrac{4x}{y}\) and passes through \((1,3)\). Find its equation (\(y>0\)).
Solution

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}\).

Example 4 — Particular solution (split the exponential)
Solve \(\dfrac{dy}{dx}=e^{x+y}\) given that \(y=0\) when \(x=0\).
Solution

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

Forgetting to divide by \(g(y)\). The variables are only separated once every \(y\) sits with \(dy\) on the left and every \(x\) with \(dx\) on the right. For \(\dfrac{dy}{dx}=xy^2\) that means \(\dfrac{dy}{y^2}=x\,dx\), not \(\dfrac{dy}{y}=x\,dx\).
Adding a constant on both sides. Integrating each side does produce a constant, but they merge into one. Write a single \(+c\) on the \(x\)-side only.
Dropping the constant before it is used. Keep \(+c\) all the way to the general solution; drop it only after an initial condition has fixed its value.
Mishandling \(\ln|y|\). To clear the logarithm you exponentiate the whole equation, giving \(y=Ae^{\,\cdots}\); you cannot simply "cancel" the \(\ln\) on one term.

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.