01 / 20

General Solutions:
Separation of Variables

Learn to solve differential equations by isolating each variable on its own side, then integrating to find the general solution.

Calculus 2

What Is a Differential Equation?

A differential equation (DE) is an equation that relates a function to one or more of its derivatives. We write the unknown function as \( y \) and its derivative as \( \frac{dy}{dx} \).

A general solution includes an arbitrary constant \( C \) because many functions can share the same derivative. A particular solution fixes \( C \) using an initial condition.

What Does "Separable" Mean?

A first-order ODE is separable if it can be written as a product of a function of \( x \) alone and a function of \( y \) alone:

✓ Separable
\( \frac{dy}{dx} = x^2 y \)
✕ Not Separable
\( \frac{dy}{dx} = x + y \)

Visual Intuition: Slope Fields

A slope field plots tiny line segments whose slopes equal \( \frac{dy}{dx} \) at each point. Each solution curve threads through these segments. The general solution is the entire family of curves, one for each value of \( C \).

x y 1 2 3 -1 -2 -3 2 4 -2
\( \frac{dy}{dx} = \frac{x}{4} \)
C = 2 C = 0 C = -2

The Core Method

Given a separable ODE \( \frac{dy}{dx} = f(x) \cdot g(y) \), the technique has one key move: treat \( dy \) and \( dx \) as separable differentials.

The constant \( C \) appears because each side produces its own constant of integration: we combine them into a single \( C \) on one side.

Formal Theorem

Left Side
Integrate with respect to \( y \): all \( y \)-terms only
Right Side
Integrate with respect to \( x \): all \( x \)-terms only
+ C
One constant of integration captures the full family

Separable vs. Non-Separable

Not every first-order ODE can be solved this way. The critical test: can you factor the right side into \( f(x) \cdot g(y) \)?

Equation Separable? Why?
\( \frac{dy}{dx} = xy^2 \) ✓ Yes \( f(x) = x,\; g(y) = y^2 \)
\( \frac{dy}{dx} = e^{x+y} \) ✓ Yes \( e^{x+y} = e^x \cdot e^y \)
\( \frac{dy}{dx} = x + y \) ✕ No Sum, not product
\( \frac{dy}{dx} = \sin(xy) \) ✕ No Cannot factor \( xy \) inside \(\sin\)

How to Apply the Method

1
Identify separability. Confirm the ODE has the form \( \frac{dy}{dx} = f(x) \cdot g(y) \).
2
Separate variables. Divide both sides by \( g(y) \) and multiply both sides by \( dx \).
3
Integrate both sides. Left side with respect to \( y \), right side with respect to \( x \). Add \( + C \).
4
Solve for \( y \) if possible. Some solutions remain implicit; that is perfectly valid.
5
Check for lost solutions. If you divided by \( g(y) \), check whether \( g(y) = 0 \) gives an additional constant solution.

Example 1: Basic Separation

Solve: \( \frac{dy}{dx} = 3x^2 y \)

1
Separate: \( \frac{1}{y}\,dy = 3x^2\,dx \)
2
Integrate: \( \displaystyle\int \frac{1}{y}\,dy = \int 3x^2\,dx \)
3
Evaluate: \( \ln|y| = x^3 + C_1 \)
4
Solve for \( y \): \( y = e^{x^3 + C_1} = e^{C_1} \cdot e^{x^3} \)

Example 2: Implicit Solution

Solve: \( \frac{dy}{dx} = \frac{x}{y^2} \)

1
Separate: \( y^2\,dy = x\,dx \)
2
Integrate: \( \displaystyle\int y^2\,dy = \int x\,dx \)
3
Evaluate: \( \frac{y^3}{3} = \frac{x^2}{2} + C \)

Example 3: Exponential Growth

Solve: \( \frac{dy}{dx} = ky \), where \( k \) is a constant.

1
Separate: \( \frac{1}{y}\,dy = k\,dx \)
2
Integrate: \( \ln|y| = kx + C_1 \)
3
Exponentiate: \( y = Ae^{kx} \), where \( A = \pm e^{C_1} \)
x y 1 2 3 A = 1 A = 2 A = 0.5

Example 4: Trigonometric ODE

Solve: \( \frac{dy}{dx} = \frac{\cos x}{e^y} \)

1
Rewrite: \( \frac{dy}{dx} = \cos x \cdot e^{-y} \), so \( g(y) = e^{-y} \) and \( \frac{1}{g(y)} = e^y \).
2
Separate: \( e^y\,dy = \cos x\,dx \)
3
Integrate: \( e^y = \sin x + C \)
4
Solve for \( y \): \( y = \ln(\sin x + C) \), valid when \( \sin x + C > 0 \).

Implicit vs. Explicit Solutions

After integrating, you may not always be able to isolate \( y \). Both forms are valid general solutions.

Explicit
\( y = f(x, C) \) — solved for \( y \) directly. Example: \( y = Ae^{kx} \)
Implicit
\( F(x, y) = C \) — \( y \) cannot be isolated cleanly. Example: \( y^2 + \sin y = x^3 + C \)

Common Mistakes

✕ Forgetting \( +C \)
After integrating both sides, you need one constant of integration. Without \( C \), you have a particular solution, not the general one.
✕ Losing Solutions
Dividing by \( g(y) \) assumes \( g(y) \neq 0 \). Always check if \( g(y) = 0 \) yields a constant solution (e.g., \( y = 0 \)).
✕ Wrong Algebra with \( \ln \)
When exponentiating \( \ln|y| = f(x) + C \), remember: \( |y| = e^{f(x)+C} \), so \( y = \pm e^C \cdot e^{f(x)} \). Don't drop the absolute value.

Summary of the Method

Step Action Result
1. Check form Factor as \( f(x) \cdot g(y) \) Confirm separable
2. Separate \( \frac{1}{g(y)}\,dy = f(x)\,dx \) Variables isolated
3. Integrate \( \int \) both sides Implicit equation
4. Solve for \( y \) Algebra (if possible) Explicit solution
5. Add \( +C \) Include constant General solution
6. Check \( g(y)=0 \) Test constant solutions No solutions lost

Question 1 of 5

Which of the following ODEs is separable?

Question 2 of 5

After separating \( \frac{dy}{dx} = 2xy \), which equation should you integrate?

Question 3 of 5

What is the general solution of \( \frac{dy}{dx} = 2xy \)?

Question 4 of 5

When solving \( \frac{dy}{dx} = y^2 \sin x \), which constant solution might be lost during separation?

Question 5 of 5

The general solution of \( \frac{dy}{dx} = \frac{e^x}{y} \) is: