Separation of Variables — Definition, Formula & Examples
Separation of variables is a technique for solving a differential equation by rearranging it so that each variable and its differential appear on opposite sides of the equation, then integrating both sides independently.
Given a first-order ODE of the form , separation of variables rewrites the equation as , provided . Integrating both sides yields an implicit (or explicit) solution relating and .
Key Formula
Where:
- = A function of x only
- = A function of y only (assumed nonzero)
- = Constant of integration
How It Works
First, check that the ODE can be written as a product of a function of alone and a function of alone. Move all -terms (including ) to one side and all -terms (including ) to the other. Integrate both sides separately, remembering to include a constant of integration. Finally, solve for explicitly if possible, and apply any initial condition to determine the constant.
Worked Example
Problem: Solve the initial value problem: dy/dx = 2x·y, with y(0) = 3.
Separate: Divide both sides by y and multiply both sides by dx to isolate each variable.
Integrate: Integrate the left side with respect to y and the right side with respect to x.
Solve and apply initial condition: Exponentiate both sides to solve for y, then use y(0) = 3 to find the constant.
Answer:
Why It Matters
Separation of variables is typically the first solution technique taught in a differential equations course, and it applies directly to modeling exponential growth, radioactive decay, Newton's law of cooling, and other processes where the rate of change factors into independent parts. In partial differential equations, extended versions of this method are used to solve the heat equation, wave equation, and Laplace's equation.
Common Mistakes
Mistake: Forgetting to check that g(y) ≠ 0, which can cause division by zero and lost solutions.
Correction: Before dividing by g(y), note any values where g(y) = 0. These constant solutions (equilibrium solutions) must be stated separately — for example, y = 0 is a solution to dy/dx = 2xy that the general solution y = Ae^{x²} only captures when A = 0.
