- Foundation
- About 15 min
- 5 practice questions
Solving by separating the variables
Solve first-order equations of the form dy/dx = f(x)g(y) by putting all the y terms on one side and all the x terms on the other, integrating, and using a condition to find a particular solution.
If something looks wrong, please tell us.
So far we have checked solutions and formed equations. Now we solve them. The simplest and most widely used method is separation of variables. It works whenever the rate dy/dx splits into a part depending only on x times a part depending only on y. Many growth, decay and cooling problems lead to equations of exactly this kind, which you will meet in the next lesson.
When an equation is separable
A first-order equation is called variable separable if it can be written as dy/dx = f(x) g(y), a function of x alone multiplied by a function of y alone. For example, dy/dx = 2xy, dy/dx = x/y and dy/dx = e^(x − y) = eˣ × e^(−y) are all separable. By contrast, dy/dx = x + y and dy/dx = sin(x + y) cannot be split into such a product, so this method does not apply to them directly.
The method
If g(y) ≠ 0, divide by g(y) and multiply by dx, so that y and dy are on the left and x and dx on the right: dy/g(y) = f(x) dx. Then integrate both sides and add one arbitrary constant, usually on the x side. The result is the general solution, often in implicit form (a relation between x and y rather than y written alone). If a condition is given, substitute it to find the constant.
If dy/dx = f(x) g(y), then ∫ dy/g(y) = ∫ f(x) dx + C. Use one constant only, and find it from the given condition.
One caution: dividing by g(y) assumes g(y) is not zero. Values of y with g(y) = 0 give constant solutions that may be lost in the division. For dy/dx = 2xy, for instance, y = 0 is a solution. In questions with a condition such as y(0) = 3, this does not usually matter, but it is good to be aware of it.
Worked example 1
Solve dy/dx = x/y. Separate: y dy = x dx. Integrate: y²/2 = x²/2 + C₁. Multiplying by 2 and renaming 2C₁ as C gives the general solution y² = x² + C, or y² − x² = C. Check by implicit differentiation: 2y y′ = 2x, so y′ = x/y, as required.
Worked example 2
Solve dy/dx = e^(x − y). Write the right side as eˣ e^(−y) and separate: eʸ dy = eˣ dx. Integrating, eʸ = eˣ + C. If we also know y(0) = 0, then 1 = 1 + C, so C = 0 and eʸ = eˣ, that is y = x. Check: dy/dx = 1 and e^(x − x) = e⁰ = 1.
Worked example 3: a particular solution
Solve dy/dx = 2xy with y(0) = 3. For y ≠ 0, separate: dy/y = 2x dx. Integrate: ln|y| = x² + C₁, so |y| = e^(C₁) e^(x²), which gives y = Ae^(x²) for a constant A (A = 0 covers the solution y = 0 as well). Using y(0) = 3: 3 = Ae⁰, so A = 3. The particular solution is y = 3e^(x²). Check: dy/dx = 6x e^(x²) = 2x × 3e^(x²) = 2xy.
Worked example 4: inverse tangents
Solve (1 + x²) dy/dx = 1 + y². Separate: dy/(1 + y²) = dx/(1 + x²). Both integrals are standard: tan⁻¹ y = tan⁻¹ x + C. A recognisable standard integral on each side is a strong hint that separation is the intended method.
Key takeaways
Recognise the form dy/dx = f(x)g(y), separate the variables, integrate each side, and add one constant. Write logarithm constants as a multiplying constant A when the answer is exponential. Finally, use any given condition to fix the constant, and check by differentiating. In the next lesson this single method will describe growth and decay.
Check your understanding
-
1. What is the solution of dy/dx = 3x² with y(0) = 1?
- y = x³
- y = 3x³ + 1
- y = 6x + 1
- y = x³ + 1
Show answer
Answer: D. Separate and integrate: y = x³ + C. Then y(0) = C = 1, so y = x³ + 1.
-
2. What is the general solution of dy/dx = y/x, for x > 0 and y > 0?
- y = x + C
- y = Cx²
- y = C/x
- y = Cx
Show answer
Answer: D. dy/y = dx/x, so ln y = ln x + ln C, giving y = Cx. Check: y′ = C = y/x.
-
3. What is the general solution of dy/dx = e^(x + y)?
- eˣ − eʸ = C
- eˣ + e^(−y) = C
- eˣ + eʸ = C
- e^(−x) + eʸ = C
Show answer
Answer: B. Separate: e^(−y) dy = eˣ dx. Integrate: −e^(−y) = eˣ + C₁, that is eˣ + e^(−y) = C. Check: eˣ − e^(−y) y′ = 0 gives y′ = e^(x + y).
-
4. Which of these equations is variable separable?
- dy/dx = (x + 1)(y − 2)
- dy/dx = x + y
- dy/dx = sin(x + y)
- dy/dx = x² + y²
Show answer
Answer: A. (x + 1)(y − 2) is a function of x times a function of y. The other right-hand sides cannot be written as such a product.
-
5. If dy/dx = y and y(0) = 2, what is y(1)?
- 2
- e²
- 2e
- e + 2
Show answer
Answer: C. dy/y = dx gives y = Aeˣ; y(0) = 2 gives A = 2. So y(1) = 2e.
Sign in to keep track of the lessons you finish.