# Separation of variables for differential equations

> IB Mathematics AI HL · IB Math AI HL
> Source: https://www.owlsprep.com/study/ib-math-ai-hl-u4-separation-of-variables-for-differential/

Separation of variables is a core method for solving first-order separable differential equations, commonly used to model growth, decay, and real-world rate processes. This guide covers key steps, solutions, and common exam traps.

**Prerequisites:** [Basic indefinite integration](https://www.owlsprep.com/study/ib-math-ai-hl-u3-indefinite-integration/); [Introduction to first-order differential equations](https://www.owlsprep.com/study/ib-math-ai-hl-u4-intro-differential-equations/)

## Learning objectives

- Identify separable first-order differential equations
- Apply separation of variables to find general solutions
- Calculate particular solutions using initial conditions
- Solve applied context problems with separable differential equations

## Identifying Separable Differential Equations

A first-order differential equation is separable if it can be rearranged to isolate all $y$ terms on one side and all $x$ terms on the other.

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

**Separable differential equation** — A first-order differential equation that can be split into two independent functions of $x$ and $y$, allowing separate integration of each variable.

*Example:* $\frac{dy}{dx} = xy$ is separable, while $\frac{dy}{dx} = x + y$ is not.

**Worked example:** Determine if $\frac{dy}{dx} = \frac{xy^3}{1 + x^2}$ is separable.

1. Factor the right-hand side into products of functions of $x$ only and $y$ only:
2. $$\frac{dy}{dx} = \left(\frac{x}{1 + x^2}\right) \times y^3$$
3. Since the first term depends only on $x$ and the second only on $y$, the equation is separable.

**Check your understanding**

Confirm your understanding:

1. Is $\frac{dy}{dx} = y^2 x$ separable?

   - Yes
   - No

   *Answer:* Yes

   *Why:* This can be rewritten as $\frac{1}{y^2} dy = x dx$, so it is separable.

2. Is $\frac{dy}{dx} = x + 2y$ separable?

   - Yes
   - No

   *Answer:* No

   *Why:* This cannot be split into a product of $x$-only and $y$-only functions, so it is not separable.

## Finding the General Solution

Once you confirm an equation is separable, follow these three core steps to get the general solution, which includes the arbitrary constant of integration representing the full family of solutions.

1. Rearrange to group all $y$ terms with $dy$ on one side, and all $x$ terms with $dx$ on the other
2. Integrate both sides with respect to their respective variables
3. Simplify to express $y$ as a function of $x$, leaving the constant of integration in place

> **tip**
>
> You only need one constant of integration for the entire solution, not one on each side. Two constants can always be combined into a single arbitrary constant.

**Worked example:** Find the general solution of $\frac{dy}{dx} = 3x^2 y$.

1. Separate variables:
2. $$\frac{1}{y} dy = 3x^2 dx$$
3. Integrate both sides:
4. $$\int \frac{1}{y} dy = \int 3x^2 dx$$
5. Evaluate integrals and add the constant of integration:
6. $$\ln|y| = x^3 + C$$
7. Exponentiate to solve for $y$, where $A = e^C$ is an arbitrary constant:
8. $$y = A e^{x^3}$$

## Finding Particular Solutions with Initial Conditions

Most exam problems give an initial condition (a point $(x_0, y_0)$ that the solution passes through) to find a single specific solution, called a particular solution.

**Particular solution** — A specific solution that satisfies both the differential equation and the given initial condition, with no arbitrary constants remaining.

**Worked example:** Given $\frac{dy}{dx} = 3x^2 y$ with $y(0) = 2$, find the particular solution.

1. Start from the general solution found earlier:
2. $$y = A e^{x^3}$$
3. Substitute the initial condition $x=0, y=2$ to solve for $A$:
4. $$2 = A e^{0^3} = A(1) \implies A = 2$$
5. Substitute $A$ back to get the particular solution:
6. $$y = 2 e^{x^3}$$

> **tip**
>
> Always find the general solution first before substituting the initial condition. Substituting early will give an incorrect result.

## Applied Problems in Context

Separation of variables is widely used to solve real-world rate problems, including population growth, radioactive decay, and cooling. You will first translate the problem description into a differential equation, then solve it using the steps above.

**Worked example:** The rate of growth of a bacteria population is proportional to the current population $P$ at time $t$ hours. At $t=0$, the population is 1000. After 2 hours, it is 3000. Find $P(t)$.

1. Translate the problem into a differential equation, where $k$ is a constant of proportionality:
2. $$\frac{dP}{dt} = kP$$
3. Separate and integrate to get the general solution:
4. $$\int \frac{1}{P} dP = \int k dt \implies P(t) = A e^{kt}$$
5. Use the initial condition $P(0) = 1000$ to find $A$:
6. $$1000 = A e^{0} \implies A = 1000$$
7. Use the second condition $P(2) = 3000$ to find $k$:
8. $$3000 = 1000 e^{2k} \implies 2k = \ln 3 \implies k = \frac{1}{2}\ln 3$$
9. Write the final simplified solution:
10. $$P(t) = 1000 (3)^{\frac{t}{2}}$$

## Common pitfalls

- **Wrong:** Forgetting to add the constant of integration after integrating
  - Why it fails: Without the constant, you only get one arbitrary solution, not the general solution required for full marks
  - Correct: Add the constant of integration to one side immediately after integrating both sides
- **Wrong:** Trying to separate non-separable differential equations
  - Why it fails: You will waste time in the exam and cannot get a correct solution with this method
  - Correct: Check if the right-hand side can be factored into $f(x)g(y)$ before starting separation
- **Wrong:** Adding separate constants to both the $x$ and $y$ sides
  - Why it fails: This creates unnecessary extra work and increases the risk of algebraic errors
  - Correct: Only add one constant to the $x$ side after integrating both sides
- **Wrong:** Substituting the initial condition before integrating
  - Why it fails: You lose the information needed to correctly calculate the constant of integration
  - Correct: Find the full general solution first, then substitute the initial condition to find the constant

## Cheatsheet

| Step | Action |
| --- | --- |
| 1 | Check if $\frac{dy}{dx} = f(x)g(y)$ (separable) |
| 2 | Rearrange: $\frac{1}{g(y)} dy = f(x) dx$ |
| 3 | Integrate both sides, add $C$ to one side |
| 4 | Simplify to get general solution |
| 5 | Substitute initial condition for particular solution |

## What's next

Separation of variables is the foundation for all differential equation work in IB Math AI HL, and is regularly tested in both paper 1 and paper 2, often in applied context problems worth 5-8 marks. Mastering this method will prepare you for numerical methods for differential equations and more complex population models, which are common topics in the final exam.

- [Differential equations for growth, decay and logistic models](https://www.owlsprep.com/study/ib-math-ai-hl-u4-differential-equations-for-growth-decay/)
- [Statistics and probability](https://www.owlsprep.com/study/ib-math-ai-hl-u5-overview/)
- [Data types, sampling, bias](https://www.owlsprep.com/study/ib-math-ai-hl-u5-data-types-sampling-bias/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-hl-u4-separation-of-variables-for-differential/
