Differential Equations • Topic 2 of 3

Variable-Separable Differential Equations

A first-order differential equation is variable-separable if it can be rearranged so that everything involving $y$ (together with $dy$) sits on one side and everything involving $x$ (together with $dx$) sits on the other:

$$\frac{dy}{dx}=g(x)\,h(y)\ \Longrightarrow\ \frac{dy}{h(y)}=g(x)\,dx.$$

Once separated, integrate each side independently. The two constants of integration merge into a single arbitrary constant $C$, which is why a first-order DE has exactly one constant in its general solution.

Method for separable equations

  • Bring the equation to the form $\dfrac{dy}{h(y)}=g(x)\,dx$.
  • Integrate both sides; write a single constant $C$.
  • Simplify (often the logarithm constant is written as $\ln C$ so that the answer comes out in product form $y=Cf(x)$).
  • If an initial condition is given, substitute it to find $C$ and obtain the particular solution.

A constant on the right may be written as $\ln C$ or $C$ — choose whichever makes the algebra cleanest. For instance integrating $\dfrac{dy}{y}=k\,dx$ gives $\ln|y|=kx+C_1$, and writing $C_1=\ln C$ tidies this to $y=Ce^{kx}$.

Applications: growth, decay, cooling and interest

Many real processes obey "rate of change is proportional to the present amount", which is the separable equation $\dfrac{dy}{dt}=ky$ with solution $y=y_0e^{kt}$ (take $k>0$ for growth, $k<0$ for decay). Common models:

ProcessModelSolution
Population / bacteria growth$\dfrac{dP}{dt}=kP$$P=P_0e^{kt}$
Radioactive decay$\dfrac{dN}{dt}=-kN$$N=N_0e^{-kt}$
Continuous interest$\dfrac{dA}{dt}=rA$$A=A_0e^{rt}$
Newton's cooling$\dfrac{dT}{dt}=-k(T-T_s)$$T=T_s+(T_0-T_s)e^{-kt}$

In Newton's law of cooling the temperature difference $T-T_s$ above the surroundings $T_s$ decays exponentially; the substitution $u=T-T_s$ turns the equation into the standard $\dfrac{du}{dt}=-ku$.

Homogeneous differential equations

A first-order DE $\dfrac{dy}{dx}=F(x,y)$ is homogeneous when the right-hand side depends on $x$ and $y$ only through the ratio $\dfrac{y}{x}$ — equivalently, when $F(\lambda x,\lambda y)=F(x,y)$ for every $\lambda$. Such equations are usually not separable as they stand, but a substitution makes them so.

A function $f(x,y)$ is homogeneous of degree $n$ if $f(\lambda x,\lambda y)=\lambda^{n}f(x,y)$. An equation written as $\dfrac{dy}{dx}=\dfrac{P(x,y)}{Q(x,y)}$ is homogeneous when $P$ and $Q$ are homogeneous of the same degree, because then the $\lambda$'s cancel and the ratio depends only on $y/x$.

Substitution. Put $y=vx$, so $\dfrac{dy}{dx}=v+x\dfrac{dv}{dx}$. The equation becomes separable in $v$ and $x$:

$$v+x\frac{dv}{dx}=F(v)\ \Longrightarrow\ \frac{dv}{F(v)-v}=\frac{dx}{x}.$$

Integrate, then replace $v$ by $\dfrac{y}{x}$ to return to the original variables. If instead the ratio appears naturally as $\dfrac{x}{y}$ (i.e. the equation is easier in terms of $x/y$), use $x=vy$ with $\dfrac{dx}{dy}=v+y\dfrac{dv}{dy}$.

Recognising homogeneity quickly: divide numerator and denominator of the right-hand side by the highest power of $x$. If every remaining term is a function of $\dfrac{y}{x}$ alone, the equation is homogeneous. For example $\dfrac{x^2+y^2}{xy}=\dfrac{1+(y/x)^2}{y/x}$ is purely in $y/x$, so it is homogeneous.

Deeper Insight — separation is the engine, substitution just feeds it. Every technique in this topic ultimately reduces to "separate and integrate". The growth/decay/cooling models are nothing but $\dfrac{dy}{dt}=ky$ in disguise — once you recognise the proportionality, the exponential answer is automatic. Homogeneous equations look harder only because the variables are tangled; the substitution $y=vx$ exists for a single reason — it untangles them so that the same separable machinery applies. So do not memorise four separate "types"; learn to spot when a clever substitution turns a stubborn equation back into the separable form you already know.

Solution curves of dy/dt = k y: exponential growth y = e^x for k greater than 0 and decay y = e^(-x) for k less than 0, both through (0,1) Solutions of dy/dt = k y → y = y₀ e^{kt} t y O y₀=1 y=e^{x} (k>0, growth) y=e^{−x} (k<0, decay)
1
Worked Example
Solve $\dfrac{dy}{dx}=\dfrac{x}{y}$.
Solution
  1. Separate: $y\,dy=x\,dx$.
  2. Integrate: $\dfrac{y^2}{2}=\dfrac{x^2}{2}+C_1$.
  3. Multiply by $2$ and absorb the constant.

Answer: $y^2-x^2=C$.

2
Worked Example
Solve $\dfrac{dy}{dx}=ky$ and identify the law it represents.
Solution
  1. Separate: $\dfrac{dy}{y}=k\,dx$.
  2. Integrate: $\ln|y|=kx+C_1$.
  3. Write $C_1=\ln C$: $y=Ce^{kx}$.

Answer: $y=Ce^{kx}$ — the exponential growth ($k>0$) / decay ($k<0$) law.

3
Worked Example
Solve $\dfrac{dy}{dx}=(1+x)(1+y)$.
Solution
  1. Separate: $\dfrac{dy}{1+y}=(1+x)\,dx$.
  2. Integrate both sides.

Answer: $\ln|1+y|=x+\dfrac{x^2}{2}+C$.

4
Worked Example
Solve $\dfrac{dy}{dx}=e^{x-y}$.
Solution
  1. Write $e^{x-y}=e^{x}e^{-y}$, so $e^{y}\,dy=e^{x}\,dx$.
  2. Integrate: $e^{y}=e^{x}+C$.

Answer: $e^{y}=e^{x}+C$.

5
Worked Example
Solve $(1+x^2)\dfrac{dy}{dx}=1$ given $y(0)=0$.
Solution
  1. Separate: $dy=\dfrac{dx}{1+x^2}$.
  2. Integrate: $y=\tan^{-1}x+C$.
  3. Apply $y(0)=0$: $0=\tan^{-1}0+C\Rightarrow C=0$.

Answer: $y=\tan^{-1}x$.

6
Worked Example
A bacterial culture grows so that $\dfrac{dP}{dt}=kP$. If the population doubles in $3$ hours, find how long it takes to triple.
Solution
  1. General solution $P=P_0e^{kt}$.
  2. Doubling: $2P_0=P_0e^{3k}\Rightarrow e^{3k}=2\Rightarrow k=\dfrac{\ln 2}{3}$.
  3. Tripling: $3=e^{kt}\Rightarrow t=\dfrac{\ln 3}{k}=\dfrac{3\ln 3}{\ln 2}$.

Answer: $t=\dfrac{3\ln 3}{\ln 2}\approx 4.75$ hours.

7
Worked Example
A body cools from $80^\circ$C to $60^\circ$C in $10$ minutes in surroundings at $20^\circ$C. Using Newton's law of cooling, find its temperature after a further $10$ minutes.
Solution
  1. $\dfrac{dT}{dt}=-k(T-20)$ gives $T-20=(T_0-20)e^{-kt}=60e^{-kt}$.
  2. At $t=10$: $60-20=60e^{-10k}\Rightarrow e^{-10k}=\dfrac{40}{60}=\dfrac{2}{3}$.
  3. At $t=20$: $T-20=60\left(e^{-10k}\right)^2=60\cdot\dfrac{4}{9}=\dfrac{80}{3}$.
  4. So $T=20+\dfrac{80}{3}=\dfrac{140}{3}$.

Answer: $T=\dfrac{140}{3}\approx 46.7^\circ$C.

8
Worked Example
A sum is invested at $10\%$ per annum compounded continuously, so $\dfrac{dA}{dt}=0.1A$. Find the time for the amount to double.
Solution
  1. Solution $A=A_0e^{0.1t}$.
  2. Doubling: $2=e^{0.1t}\Rightarrow 0.1t=\ln 2$.
  3. $t=10\ln 2$.

Answer: $t=10\ln 2\approx 6.93$ years.

9
Worked Example
Solve the homogeneous equation $\dfrac{dy}{dx}=\dfrac{x+y}{x}$.
Solution
  1. RHS $=1+\dfrac{y}{x}$ — depends only on $y/x$, so homogeneous. Put $y=vx$, $\dfrac{dy}{dx}=v+x\dfrac{dv}{dx}$.
  2. $v+x\dfrac{dv}{dx}=1+v\Rightarrow x\dfrac{dv}{dx}=1$.
  3. Separate: $dv=\dfrac{dx}{x}\Rightarrow v=\ln|x|+C$.
  4. Back-substitute $v=\dfrac{y}{x}$.

Answer: $\dfrac{y}{x}=\ln|x|+C$, i.e. $y=x(\ln|x|+C)$.

10
Worked Example
Solve $\dfrac{dy}{dx}=\dfrac{x^2+y^2}{xy}$.
Solution
  1. RHS $=\dfrac{x}{y}+\dfrac{y}{x}=\dfrac{1}{v}+v$ with $y=vx$; homogeneous.
  2. $v+x\dfrac{dv}{dx}=\dfrac{1}{v}+v\Rightarrow x\dfrac{dv}{dx}=\dfrac{1}{v}$.
  3. Separate: $v\,dv=\dfrac{dx}{x}\Rightarrow \dfrac{v^2}{2}=\ln|x|+C_1$.
  4. Replace $v=\dfrac{y}{x}$: $\dfrac{y^2}{2x^2}=\ln|x|+C_1$.

Answer: $y^2=2x^2\ln|x|+Cx^2$.

11
Worked Example
Solve $\dfrac{dy}{dx}=\dfrac{y}{x}+\tan\!\left(\dfrac{y}{x}\right)$.
Solution
  1. Already in terms of $y/x$; put $y=vx$: $v+x\dfrac{dv}{dx}=v+\tan v$.
  2. $x\dfrac{dv}{dx}=\tan v\Rightarrow \cot v\,dv=\dfrac{dx}{x}$.
  3. Integrate: $\ln|\sin v|=\ln|x|+\ln C$.
  4. So $\sin v=Cx$, and $v=\dfrac{y}{x}$.

Answer: $\sin\!\left(\dfrac{y}{x}\right)=Cx$.

12
Worked Example
Solve $\dfrac{dy}{dx}=y\tan x$ given $y(0)=1$.
Solution
  1. Separate: $\dfrac{dy}{y}=\tan x\,dx$.
  2. Integrate: $\ln|y|=\ln|\sec x|+C_1$, so $y=C\sec x$.
  3. Apply $y(0)=1$: $1=C\sec 0=C\Rightarrow C=1$.

Answer: $y=\sec x$.

Key Points

  • Separable form: $\dfrac{dy}{h(y)}=g(x)\,dx$; integrate each side and merge into one constant $C$.
  • $\dfrac{dy}{dt}=ky$ gives $y=y_0e^{kt}$ — growth for $k>0$, decay for $k<0$.
  • Newton's cooling: $\dfrac{dT}{dt}=-k(T-T_s)\Rightarrow T=T_s+(T_0-T_s)e^{-kt}$ (substitute $u=T-T_s$).
  • Continuous interest follows the same exponential law $A=A_0e^{rt}$.
  • A first-order DE is homogeneous when the RHS depends only on $\dfrac{y}{x}$ (numerator and denominator homogeneous of equal degree).
  • For homogeneous equations substitute $y=vx$, $\dfrac{dy}{dx}=v+x\dfrac{dv}{dx}$ — this makes them separable; use $x=vy$ if the ratio $x/y$ is more natural.
  • After solving in $v$, always back-substitute $v=\dfrac{y}{x}$ (or $\dfrac{x}{y}$) to return to $x,y$.
  • Apply any initial condition only after finding the general solution, to pin down $C$.
Tap an option to check your answer0 / 4
Q1.Solving $\dfrac{dy}{dx}=\dfrac{x}{y}$ gives:
Explanation: $y\,dy=x\,dx\Rightarrow y^2-x^2=C$.
Q2.The solution of $\dfrac{dy}{dx}=ky$ is:
Explanation: Exponential law $y=Ce^{kx}$.
Q3.A DE is separable if it can be written as:
Explanation: Variables on opposite sides.
Q4.Solving $e^{y}dy=e^{x}dx$ gives:
Explanation: Integrate both sides directly.