Separable Differential Equations

Learning Objectives
  • Identify separable differential equations
  • Master the separation of variables technique
  • Solve initial value problems using separable methods
  • Understand singular and equilibrium solutions
  • Determine intervals of existence and uniqueness

What is a Separable Equation?

A separable differential equation is one where we can separate the variables on opposite sides of the equation. The general form is:

Definition: Separable Differential Equation A first-order ODE is separable if it can be written as: $$\frac{dy}{dx} = f(x) \cdot g(y)$$ or equivalently: $$g(y)\,dy = f(x)\,dx$$

Separable vs. Non-Separable Equations

Separable examples:

Non-separable examples:

Real-World Applications

Separable equations model numerous physical phenomena:

The art of separating variables was one of the first techniques developed for solving differential equations, pioneered by Leibniz and the Bernoulli brothers in the 1690s. It remains the most natural method — when it works, the solution is almost effortless.

— Gottfried Wilhelm Leibniz (1646–1716), co-inventor of calculus

Mathematical Theory

The Separation Technique

Given a separable equation:

$$\frac{dy}{dx} = f(x) \cdot g(y)$$

We separate variables by:

  1. Divide both sides by $g(y)$ (assuming $g(y) \neq 0$)
  2. Multiply both sides by $dx$
  3. Integrate both sides

This gives us:

$$\int \frac{1}{g(y)}\,dy = \int f(x)\,dx + C$$
Theorem: Existence and Uniqueness For the initial value problem $\frac{dy}{dx} = f(x)g(y)$ with $y(x_0) = y_0$:
  • If $f(x)$ is continuous on an interval containing $x_0$
  • And $g(y)$ is continuous and $g(y_0) \neq 0$
  • Then there exists a unique solution in some neighborhood of $(x_0, y_0)$
⚠️ Warning: Dividing by Zero When we divide by $g(y)$, we assume $g(y) \neq 0$. The points where $g(y) = 0$ are called equilibrium solutions or singular solutions. These are constant solutions that we must check separately!

For example, if $\frac{dy}{dx} = y(1-y)$, both $y=0$ and $y=1$ are equilibrium solutions.

💡 Tip: Check for Lost Solutions Always verify that any equilibrium solutions (zeros of $g(y)$) are indeed solutions to the original equation. After integrating and solving for $y$, also check your implicit solution by implicit differentiation!

Implicit vs. Explicit Solutions

Sometimes integrating gives us an implicit solution $F(x,y) = C$ that cannot be easily solved for $y$ explicitly. Both forms are valid solutions:

Step-by-Step Solution Method

Follow these six steps to solve a separable differential equation:

  1. Write in separable form: Rewrite $\frac{dy}{dx} = \text{something}$ as $\frac{dy}{dx} = f(x) \cdot g(y)$ or check if it can be separated.
  2. Separate variables: Rearrange to get all $y$ terms on the left and all $x$ terms on the right: $\frac{1}{g(y)}\,dy = f(x)\,dx$
  3. Integrate both sides: $\int \frac{1}{g(y)}\,dy = \int f(x)\,dx + C$
  4. Solve for $y$ if possible: If the integrals are tractable, solve the implicit equation for $y$ explicitly. Otherwise, leave in implicit form.
  5. Apply initial conditions: Use $y(x_0) = y_0$ to find the particular constant $C$.
  6. Check for equilibrium solutions: Set $g(y) = 0$ and verify these constant solutions satisfy the original ODE.

Worked Examples

Example 1: $\dfrac{dy}{dx} = xy$ with $y(0) = 2$

Solution

Step 1–2: Separate variables

$$\frac{dy}{dx} = xy$$ $$\frac{dy}{y} = x\,dx$$

Step 3: Integrate both sides

$$\int \frac{dy}{y} = \int x\,dx$$ $$\ln|y| = \frac{x^2}{2} + C$$

Step 4: Solve for $y$

$$|y| = e^{x^2/2 + C} = e^C \cdot e^{x^2/2}$$ $$y = Ae^{x^2/2} \quad \text{where } A = \pm e^C$$

Step 5: Apply initial condition $y(0) = 2$

$$2 = Ae^{0} = A$$ $$A = 2$$

Final Solution:

$$\boxed{y = 2e^{x^2/2}}$$
Note: This solution is defined for all real $x$ (global existence). Since $g(y) = y$ has only $y=0$ as equilibrium, and our initial condition is $y(0)=2 \neq 0$, we don't need to include it.
Example 2: $\dfrac{dy}{dx} - y - 14 = y\tan^2(2x) + 14\tan^2(2x)$

Solution

Key Insight: This equation does not look separable at first glance! The critical step is algebraic simplification before attempting separation.

Step 0: Simplify by factoring

Move everything to the right side:

$$\frac{dy}{dx} = y + 14 + y\tan^2(2x) + 14\tan^2(2x)$$

Now factor by grouping — notice $y$ and $14$ appear in the same pattern:

$$\frac{dy}{dx} = y\big(1 + \tan^2(2x)\big) + 14\big(1 + \tan^2(2x)\big)$$ $$\frac{dy}{dx} = \big(y + 14\big)\big(1 + \tan^2(2x)\big)$$

Now recall the fundamental identity: $1 + \tan^2(\theta) = \sec^2(\theta)$, so:

$$\frac{dy}{dx} = (y + 14)\sec^2(2x)$$
Now it's clearly separable! We have $f(x) = \sec^2(2x)$ and $g(y) = y + 14$.

Step 1–2: Separate variables

$$\frac{dy}{y + 14} = \sec^2(2x)\,dx$$

Step 3: Integrate both sides

$$\int \frac{dy}{y+14} = \int \sec^2(2x)\,dx$$ $$\ln|y + 14| = \frac{1}{2}\tan(2x) + C$$

Step 4: Solve for $y$

$$|y + 14| = e^{\frac{1}{2}\tan(2x) + C} = Ae^{\frac{1}{2}\tan(2x)}$$ $$\boxed{y = -14 + Ae^{\frac{1}{2}\tan(2x)}}$$
Lesson learned: Always look for common factors before declaring an equation non-separable. Factoring by grouping and trig identities can reveal hidden separable structure.

Equilibrium solution: Setting $g(y) = 0$ gives $y = -14$, which is indeed a constant solution. Verify: if $y = -14$, then $dy/dx = 0$, and the right side is $(-14+14)\sec^2(2x) = 0$. ✓

Example 3: $\dfrac{dy}{dx} = y^2\cos(x)$ with $y(0) = 1$ (Blow-up!)

Solution

Step 1–2: Separate variables

$$\frac{dy}{y^2} = \cos(x)\,dx$$

Step 3: Integrate both sides

$$\int \frac{dy}{y^2} = \int \cos(x)\,dx$$ $$-\frac{1}{y} = \sin(x) + C$$

Step 5: Apply initial condition $y(0) = 1$

$$-\frac{1}{1} = \sin(0) + C$$ $$-1 = 0 + C \implies C = -1$$

Step 4: Solve for $y$

$$-\frac{1}{y} = \sin(x) - 1$$ $$\frac{1}{y} = 1 - \sin(x)$$ $$\boxed{y = \frac{1}{1 - \sin(x)}}$$

Interval of Existence

The solution blows up (becomes undefined) when the denominator is zero:

$$1 - \sin(x) = 0 \implies \sin(x) = 1$$ $$x = \frac{\pi}{2} + 2\pi k, \quad k \in \mathbb{Z}$$

The solution exists on the interval $\boxed{-\infty < x < \frac{\pi}{2}}$ (near the initial point).

⚠️ Important: This is a finite-time blow-up. The solution becomes infinite at $x = \pi/2$. This is why the existence and uniqueness theorem only guarantees solutions in neighborhoods of $(x_0, y_0)$, not globally.
Example 4: $\dfrac{1}{1+x^2}\dfrac{dy}{dx} = e^{2y - 3x}\cdot y^{-2}$,   $y(0) = 1$

Solution

Key Insight: This equation involves products of exponentials and powers. The trick is to split the exponential $e^{2y-3x} = e^{2y}\cdot e^{-3x}$ so that $x$-terms and $y$-terms separate cleanly.

Step 0: Rewrite and identify structure

Start by multiplying both sides by $(1+x^2)$:

$$\frac{dy}{dx} = (1+x^2)\,e^{2y-3x}\,y^{-2}$$

Now split the exponential $e^{2y-3x} = e^{2y}\cdot e^{-3x}$:

$$\frac{dy}{dx} = \underbrace{(1+x^2)\,e^{-3x}}_{f(x)} \cdot \underbrace{e^{2y}\,y^{-2}}_{g(y)}$$
Separable! We have $f(x) = (1+x^2)e^{-3x}$ and $g(y) = e^{2y}/y^2$.

Step 1–2: Separate variables

$$y^2\,e^{-2y}\,dy = (1+x^2)\,e^{-3x}\,dx$$

Step 3: Integrate both sides

Left side: $\displaystyle\int y^2 e^{-2y}\,dy$ — use integration by parts twice (or tabular method):

Let $u = y^2$, $dv = e^{-2y}dy$. Apply IBP repeatedly:

$$\int y^2 e^{-2y}\,dy = -\frac{y^2}{2}e^{-2y} - \frac{y}{2}e^{-2y} - \frac{1}{4}e^{-2y} + C_1$$ $$= -\frac{e^{-2y}}{4}(2y^2 + 2y + 1) + C_1$$

Right side: $\displaystyle\int (1+x^2)e^{-3x}\,dx$ — also by parts:

$$\int e^{-3x}\,dx = -\frac{1}{3}e^{-3x}$$ $$\int x^2 e^{-3x}\,dx = -\frac{x^2}{3}e^{-3x} - \frac{2x}{9}e^{-3x} - \frac{2}{27}e^{-3x}$$

Combining:

$$\int (1+x^2)e^{-3x}\,dx = -\frac{e^{-3x}}{27}(9x^2 + 6x + 11) + C_2$$

Step 4: Implicit solution

$$\boxed{-\frac{e^{-2y}}{4}(2y^2 + 2y + 1) = -\frac{e^{-3x}}{27}(9x^2 + 6x + 11) + C}$$

Step 5: Apply initial condition $y(0) = 1$

At $x = 0$, $y = 1$:

$$-\frac{e^{-2}}{4}(2 + 2 + 1) = -\frac{1}{27}(0 + 0 + 11) + C$$ $$-\frac{5e^{-2}}{4} = -\frac{11}{27} + C$$ $$C = \frac{11}{27} - \frac{5e^{-2}}{4} = \frac{11}{27} - \frac{5}{4e^2}$$
Lessons from this example:

1. Split combined exponentials — $e^{f(x)+g(y)}$ always factors as $e^{f(x)} \cdot e^{g(y)}$.

2. Implicit solutions are fine — not every separable equation yields an explicit $y = \ldots$ form.

3. Integration skills matter — separable equations can produce integrals that require multiple rounds of integration by parts.

Example 5: RC Circuit — Charging a Capacitor

Problem Setup

A resistor-capacitor (RC) circuit is one of the most fundamental circuits in electrical engineering. A capacitor is connected in series with a resistor to a constant voltage source $V_0$. The voltage $v(t)$ across the capacitor evolves according to Kirchhoff's voltage law:

$$RC\frac{dv}{dt} + v = V_0$$

Or equivalently, isolating the derivative:

$$\frac{dv}{dt} = \frac{V_0 - v}{RC}$$

Given values:

  • Resistance: $R = 1000 \, \Omega$ (ohms)
  • Capacitance: $C = 0.001 \, \text{F}$ (farads)
  • Time constant: $\tau = RC = 1 \, \text{s}$ (second)
  • Source voltage: $V_0 = 12 \, \text{V}$
  • Initial condition: $v(0) = 0$ (capacitor initially uncharged)

Solution

Step 1: Recognize it's separable

Rewrite the differential equation:

$$\frac{dv}{dt} = \frac{1}{RC}(V_0 - v)$$

This is separable! We can separate $v$ and $t$:

$$\frac{dv}{V_0 - v} = \frac{dt}{RC}$$
Key observation: This is a linear separable ODE in standard form. Even though it's also linear (solvable by integrating factors), separation of variables is the quickest route!

Step 2: Integrate both sides

Integrate the left side with respect to $v$ and the right side with respect to $t$:

$$\int \frac{dv}{V_0 - v} = \int \frac{dt}{RC}$$

Using the substitution $u = V_0 - v$, we get $du = -dv$:

$$-\ln|V_0 - v| = \frac{t}{RC} + C$$

Simplifying:

$$\ln|V_0 - v| = -\frac{t}{RC} + C'$$

Step 3: Apply initial condition

At $t = 0$, $v(0) = 0$:

$$\ln(V_0) = C'$$

Therefore:

$$\ln|V_0 - v| = -\frac{t}{RC} + \ln(V_0)$$

Step 4: Solve for $v(t)$ explicitly

$$\ln\left|\frac{V_0 - v}{V_0}\right| = -\frac{t}{RC}$$ $$\frac{V_0 - v}{V_0} = e^{-t/(RC)}$$ $$V_0 - v = V_0 \, e^{-t/(RC)}$$ $$\boxed{v(t) = V_0\left(1 - e^{-t/(RC)}\right) = 12\left(1 - e^{-t}\right) \text{ volts}}$$

Physical Interpretation

  • At $t = 0$: $v(0) = 0$ (no charge yet)
  • As $t \to \infty$: $v(t) \to V_0 = 12$ V (fully charged)
  • At $t = \tau = RC = 1$ s: $v(1) = 12(1 - e^{-1}) \approx 12(0.632) = 7.58$ V (≈63.2% charged)
  • At $t = 5\tau = 5$ s: $v(5) = 12(1 - e^{-5}) \approx 12(0.993) = 11.92$ V (≈99.3% charged)
The Time Constant $\tau = RC$: This is the most important parameter in RC circuits!
  • $\tau$ has units of time (seconds)
  • After one time constant ($t = \tau$), the capacitor reaches 63.2% of its final voltage
  • After five time constants ($t = 5\tau$), the capacitor is 99.3% charged (essentially "fully" charged in practice)
  • Larger $RC$ means slower charging; smaller $RC$ means faster charging
Important observation: This is ALSO a first-order linear ODE solvable by integrating factors! Many real-world differential equations can be solved by multiple methods. In this case, separation of variables was simpler and more direct than the integrating factor method. In practice, always look for the quickest route to a solution.
Example 6: $\dfrac{dy}{dx} = y\cos(x) + \cos(x) + y + 1$ (Factoring by Grouping)

Solution

Step 1: Recognize the separable structure by factoring

The key is to group terms strategically:

$$\frac{dy}{dx} = \cos(x)(y + 1) + (y + 1) = (y+1)(\cos(x) + 1)$$
Factoring by Grouping: When you have four terms like $a + b + c + d$, try grouping them as $(a+c) + (b+d)$ or $(a+b) + (c+d)$ and factor each group. Here: $y\cos(x) + y + \cos(x) + 1 = y(\cos(x)+1) + 1(\cos(x)+1) = (y+1)(\cos(x)+1)$.

Step 2: Separate variables

$$\frac{dy}{y+1} = (\cos(x) + 1)\,dx$$

Step 3: Integrate both sides

$$\int \frac{dy}{y+1} = \int (\cos(x) + 1)\,dx$$ $$\ln|y+1| = \sin(x) + x + C$$

Step 4: Solve for $y$ (explicit solution)

$$|y+1| = e^{\sin(x) + x + C} = e^C \cdot e^{\sin(x) + x}$$ $$y + 1 = A \, e^{\sin(x) + x}$$ where $A = \pm e^C$ is an arbitrary constant. $$\boxed{y = A\,e^{\sin(x) + x} - 1}$$

Particular solution (if $y(0) = 0$ is given):

At $x = 0$, $y = 0$:

$$0 + 1 = A \, e^{\sin(0) + 0} = A \cdot e^0 = A$$ $$A = 1$$

So the particular solution is:

$$\boxed{y = e^{\sin(x) + x} - 1}$$
When to Use Factoring by Grouping:
  • Look for repeated polynomial or trig factors in $\frac{dy}{dx}$
  • Group like terms together and factor each group
  • This technique can transform a seemingly non-separable equation into a cleanly separable one
Example 7: $y\,\dfrac{dy}{dx} = \sin(x)$,   $y(0) = 1$

Solution

Step 1–2: Separate variables

$$y\,dy = \sin(x)\,dx$$

Step 3: Integrate both sides

$$\int y\,dy = \int \sin(x)\,dx$$ $$\frac{y^2}{2} = -\cos(x) + C$$

Step 4: Apply initial condition $y(0) = 1$

At $x = 0$, $y = 1$:

$$\frac{1^2}{2} = -\cos(0) + C$$ $$\frac{1}{2} = -1 + C$$ $$C = \frac{3}{2}$$

Step 5: Implicit solution

$$\frac{y^2}{2} = -\cos(x) + \frac{3}{2}$$ $$y^2 = -2\cos(x) + 3$$

Step 6: Solve for $y$ (explicit solution)

$$y^2 = 3 - 2\cos(x)$$ $$\boxed{y = \sqrt{3 - 2\cos(x)}}$$

We take the positive square root because the initial condition $y(0) = 1 > 0$.

Domain and Global Existence

Since $-1 \leq \cos(x) \leq 1$, we have:

$$3 - 2(1) \leq 3 - 2\cos(x) \leq 3 - 2(-1)$$ $$1 \leq 3 - 2\cos(x) \leq 5$$
Global Existence: Since $3 - 2\cos(x) \geq 1 > 0$ for all $x \in \mathbb{R}$, the solution $y = \sqrt{3 - 2\cos(x)}$ is defined for all real $x$. There are no points where the solution blows up or becomes undefined — this is a global solution!

Physical Insight

  • At $x = 0$: $y = \sqrt{3 - 2(1)} = \sqrt{1} = 1$ ✓ (matches initial condition)
  • At $x = \pi/2$: $y = \sqrt{3 - 2(0)} = \sqrt{3} \approx 1.73$ (maximum, since $\cos(\pi/2) = 0$)
  • At $x = \pi$: $y = \sqrt{3 - 2(-1)} = \sqrt{5} \approx 2.24$ (absolute maximum, since $\cos(\pi) = -1$)
  • The solution oscillates between $\sqrt{1} = 1$ and $\sqrt{5} \approx 2.24$ as $x$ varies
Example 8: $(e^y - 1)\,\dfrac{dy}{dx} = 2 + \cos(x)$ (Implicit Solution)

Solution

Step 1–2: Separate variables

$$(e^y - 1)\,dy = (2 + \cos(x))\,dx$$

Step 3: Integrate both sides

Left side:

$$\int (e^y - 1)\,dy = e^y - y + C_1$$

Right side:

$$\int (2 + \cos(x))\,dx = 2x + \sin(x) + C_2$$

Step 4: Implicit solution

$$e^y - y = 2x + \sin(x) + C$$ where $C = C_2 - C_1$ is the constant of integration. $$\boxed{e^y - y = 2x + \sin(x) + C}$$

Particular solution (if $y(0) = 0$ is given):

At $x = 0$, $y = 0$:

$$e^0 - 0 = 2(0) + \sin(0) + C$$ $$1 = 0 + C$$ $$C = 1$$

So:

$$\boxed{e^y - y = 2x + \sin(x) + 1}$$

Why We Cannot Solve Explicitly for $y$

The relation $e^y - y = 2x + \sin(x) + 1$ cannot be solved explicitly for $y$ in closed form. The transcendental function $f(y) = e^y - y$ does not have an inverse that can be expressed using elementary functions.

Implicit Solutions Are Perfectly Valid! Not every differential equation yields an explicit solution $y = y(x)$. When you cannot isolate $y$ from an equation like $F(x, y) = 0$, the implicit form is still a complete and valid solution. You can:
  • Evaluate numerically: Use numerical methods (Newton's method) to find $y$ for any given $x$
  • Analyze qualitatively: Study properties like where $\frac{dy}{dx} = 0$ or where solutions have vertical tangents
  • Plot implicitly: Many graphing tools can plot implicit relations $F(x,y) = 0$ directly

Uniqueness Check

At any point $(x_0, y_0)$ satisfying the implicit relation, we can compute:

$$\frac{dy}{dx} = \frac{2 + \cos(x)}{e^y - 1}$$

This is well-defined as long as $e^y \neq 1$ (i.e., $y \neq 0$). By the existence and uniqueness theorem, a unique solution exists through any point $(x_0, y_0)$ with $y_0 \neq 0$.

📝 Exam-Style Practice Problems

These problems are similar in style and difficulty to past exam questions. Click each problem to reveal the step-by-step solution.

Practice 1: $\dfrac{dy}{dx} = y^2\cos(x) + y^2 + \cos(x) + 1$

Solution

Step 1: Factor the right side

Group terms strategically:

$$\frac{dy}{dx} = y^2(\cos(x) + 1) + (\cos(x) + 1)$$ $$\frac{dy}{dx} = (y^2 + 1)(\cos(x) + 1)$$

Step 2: Separate variables

$$\frac{dy}{y^2 + 1} = (\cos(x) + 1)\,dx$$

Step 3: Integrate both sides

Left side: $\displaystyle \int \frac{dy}{y^2+1} = \arctan(y)$

Right side: $\displaystyle \int (\cos(x)+1)\,dx = \sin(x) + x$

Step 4: Write the general solution

$$\boxed{\arctan(y) = x + \sin(x) + C}$$
Practice 2: $\dfrac{dy}{dx} = \dfrac{x e^x}{y^2 + 1}$

Solution

Step 1: Separate variables

$$\frac{dy}{dx} = \frac{xe^x}{y^2+1}$$ $$(y^2 + 1)\,dy = xe^x\,dx$$

Step 2: Integrate the left side

$$\int (y^2 + 1)\,dy = \frac{y^3}{3} + y$$

Step 3: Integrate the right side using integration by parts

Let $u = x$, $dv = e^x\,dx$. Then $du = dx$, $v = e^x$:

$$\int xe^x\,dx = xe^x - \int e^x\,dx = xe^x - e^x = e^x(x-1)$$

Step 4: Combine and write the general solution

$$\boxed{\frac{y^3}{3} + y = xe^x - e^x + C}$$
Practice 3 (IVP): $\dfrac{dy}{dx} = \dfrac{2x}{3y^2 - 4}, \quad y(0) = 1$

Solution

Step 1: Separate variables

$$(3y^2 - 4)\,dy = 2x\,dx$$

Step 2: Integrate both sides

$$\int (3y^2-4)\,dy = \int 2x\,dx$$ $$y^3 - 4y = x^2 + C$$

Step 3: Apply the initial condition $y(0) = 1$

Substitute $x = 0$ and $y = 1$:

$$1^3 - 4(1) = 0^2 + C$$ $$1 - 4 = C$$ $$C = -3$$

Step 4: Write the particular solution

$$\boxed{y^3 - 4y = x^2 - 3}$$
Implicit vs. Explicit: This is an implicit form. You could attempt to solve for $y$ explicitly by finding the roots of the cubic $y^3 - 4y = x^2 - 3$, but the implicit form is perfectly acceptable and often preferred for its clarity.
مَنْ سَلَكَ طَرِيقًا يَلْتَمِسُ فِيهِ عِلْمًا سَهَّلَ اللَّهُ لَهُ بِهِ طَرِيقًا إِلَى الْجَنَّةِ
"Whoever travels a path in search of knowledge, Allah will make easy for him a path to Paradise."
— Prophet Muhammad ﷺ (Sahih Muslim)

Every problem you solve, every technique you master, is a step on the path of knowledge. Approach each equation with patience and determination — the effort itself is rewarded.

Practice Problems

Test your understanding with these multiple-choice questions. Click a choice to see if you're correct.

Q1: Which equation is separable?

Q2: For $\frac{dy}{dx} = 3x^2 y$, what is the correct separation?

Q3: Solve $\frac{dy}{dx} = y$ with $y(0) = 5$

Q4: What are the equilibrium solutions of $\frac{dy}{dx} = y(1-y)$?

Q5: Solve $\frac{dy}{dx} = \frac{x}{y}$ (general solution)

Q6: For $\frac{dy}{dx} = y^2$ with $y(0) = 1$, at what $x$ does the solution blow up?

0 / 6 correct

Quick Reference Card

General Form

$$\frac{dy}{dx} = f(x) \cdot g(y)$$

Separated Form

$$\frac{1}{g(y)}\,dy = f(x)\,dx$$

Integration

$$\int \frac{dy}{g(y)} = \int f(x)\,dx + C$$

Equilibrium Solutions

Set $g(y) = 0$ to find constant solutions (vertical isoclines)

Existence & Uniqueness

Guaranteed near $(x_0, y_0)$ if $g(y_0) \neq 0$

Common Integrals

$\int \frac{dy}{y} = \ln|y| + C$
$\int \frac{dy}{1+y^2} = \arctan(y) + C$
$\int \frac{dy}{a^2-y^2} = \frac{1}{2a}\ln\left|\frac{a+y}{a-y}\right| + C$