- Practice
- About 20 min
- 5 practice questions
Solutions of differential equations, variables separable and substitution
Verify that a function solves a differential equation, tell general from particular solutions, and solve first-order equations by separating variables or by the substitution z = ax + by + c.
If something looks wrong, please tell us.
By the end of this lesson you can
- Check by substitution that a given function is a solution.
- Explain general and particular solutions and how many constants each has.
- Solve an equation by the method of variables separable.
- Reduce dy/dx = f(ax + by + c) to separable form with z = ax + by + c.
Forming a differential equation removes constants; solving it brings them back. Solving a differential equation is also called integrating it, because the work is mostly integration. This lesson starts with what a solution is and then gives the first two methods for first-order, first-degree equations.
Solutions: general and particular
A solution of a differential equation is an expression for the dependent variable in terms of the independent variable that satisfies the equation. Two cautions. A differential equation need not have a real solution: (y′)² + y² + 1 = 0 would need (y′)² = −(y² + 1) < 0, which is impossible for real y′. And when solutions exist they are not unique: y = 3e^(2x), y = −e^(2x) and indeed y = c e^(2x) for every real c all satisfy y′ − 2y = 0.
- The general solution contains as many arbitrary constants as the order of the equation. y = c e^(2x) is the general solution of y′ − 2y = 0; y = a cos x + b sin x is the general solution of y″ + y = 0.
- A particular solution is obtained by giving the constants particular values, usually from extra conditions such as y(0) = 1. Taking a = 1, b = 0 gives the particular solution y = cos x of y″ + y = 0. A particular solution has no arbitrary constant left.
- The general solution of a first-order equation y′ = f(x, y) is a one-parameter family of curves in the xy-plane.
Worked example 1: verifying solutions
(i) Show that y = c/x + x² satisfies x y′ + y = 3x². Working: y′ = −c/x² + 2x, so x y′ = −c/x + 2x². Then x y′ + y = −c/x + 2x² + c/x + x² = 3x². Verified.
(ii) Show that y = A eˣ + B x eˣ satisfies y″ − 2y′ + y = 0. Working: y′ = A eˣ + B eˣ + B x eˣ and y″ = A eˣ + 2B eˣ + B x eˣ. So y″ − 2y′ + y = eˣ[(A + 2B + Bx) − 2(A + B + Bx) + (A + Bx)] = eˣ[0] = 0. Since there are two constants for a second-order equation, this is its general solution.
Method 1: variables separable
A first-order equation is separable if it can be written f₁(x)g₁(y) dx + f₂(x)g₂(y) dy = 0. Divide by f₂(x)g₁(y) to put all the x's with dx and all the y's with dy: [f₁(x)/f₂(x)] dx = −[g₂(y)/g₁(y)] dy. Integrate both sides and add one constant C; there is no need for a constant on each side, as two constants combine into one. Writing the constant as log C is often convenient when logarithms appear.
Variables separable
- Rearrange x-terms with dx, y-terms with dy.
- Integrate Integrate both sides.
- Add one constant C, or log C if logs appear.
- Use the condition Find C for a particular solution.
Worked example 2: dy/dx = x(1 + y²)
Separate: dy/(1 + y²) = x dx. Integrate: tan⁻¹ y = x²/2 + C. So y = tan(x²/2 + C) is the general solution.
Worked example 3: a particular solution
Solve (1 + x²) dy = 2xy dx given y(1) = 4. Separate: dy/y = 2x dx/(1 + x²). Integrate: log|y| = log(1 + x²) + log C, so y = C(1 + x²). Use y = 4 when x = 1: 4 = C(1 + 1), so C = 2. The particular solution is y = 2(1 + x²). Check: y′ = 4x and 2xy/(1 + x²) = 2x·2(1 + x²)/(1 + x²) = 4x.
Worked example 4: dy/dx = e^(x − y)
Write e^(x − y) = eˣ·e^(−y). Separate: e^y dy = eˣ dx. Integrate: e^y = eˣ + C.
Method 2: substitution for dy/dx = f(ax + by + c)
If the right side is a function of the single combination ax + by + c with a ≠ 0 and b ≠ 0, put z = ax + by + c. Then dz/dx = a + b dy/dx = a + b f(z), which is separable in z and x. (If a = 0 or b = 0 the equation is already separable.)
For dy/dx = f(ax + by + c) put z = ax + by + c; then dz/dx = a + b f(z), and dz/[a + b f(z)] = dx.
Worked example 5: dy/dx = (x + y)²
Put z = x + y, so dz/dx = 1 + dy/dx = 1 + z². Separate: dz/(1 + z²) = dx. Integrate: tan⁻¹ z = x + C. Hence tan⁻¹(x + y) = x + C, or x + y = tan(x + C).
Worked example 6: dy/dx = cos(x + y)
Put z = x + y: dz/dx = 1 + cos z = 2cos²(z/2). Separate: dz/[2cos²(z/2)] = dx, that is (1/2)sec²(z/2) dz = dx. Integrate: tan(z/2) = x + C. So tan((x + y)/2) = x + C.
Worked example 7: dy/dx = (x + y + 1)/(x + y − 1)
Put z = x + y: dz/dx = 1 + (z + 1)/(z − 1) = (z − 1 + z + 1)/(z − 1) = 2z/(z − 1). Separate: (z − 1)/(2z) dz = dx, that is (1/2)(1 − 1/z) dz = dx. Integrate: (1/2)(z − log|z|) = x + C₁, so z − log|z| = 2x + C. Replace z: x + y − log|x + y| = 2x + C, which simplifies to y − x − log|x + y| = C. Check by differentiating: y′ − 1 − (1 + y′)/(x + y) = 0; multiply by z = x + y: y′(z − 1) = z + 1, so y′ = (z + 1)/(z − 1), as required.
Key takeaways: a general solution has as many constants as the order; a particular solution has none. Separate the variables, integrate both sides and add one constant. When x and y occur only through ax + by + c, substitute z = ax + by + c and separate in z. Always check a solution by differentiating it.
Check your understanding
-
1. y = c₁eˣ + c₂e^(−x) + c₃x is the general solution of a differential equation. What is the order of that equation?
- 1
- 2
- 3
- 0
Show answer
Answer: C. A general solution has as many arbitrary constants as the order of the equation. Here there are three constants c₁, c₂, c₃, so the order is 3.
-
2. Which is the particular solution of dy/dx = −x/y with y(0) = 2?
- x² + y² = 4
- y² − x² = 4
- y = 2 − x
- x² + y² = 2
Show answer
Answer: A. Separate: y dy = −x dx. Integrate: y²/2 = −x²/2 + C, so x² + y² = 2C. With x = 0, y = 2: 2C = 4. Hence x² + y² = 4.
-
3. Which is the general solution of dy/dx = e^(x + y)?
- eˣ − e^y = C
- e^(x + y) = C
- eˣ + e^y = C
- eˣ + e^(−y) = C
Show answer
Answer: D. Separate: e^(−y) dy = eˣ dx. Integrate: −e^(−y) = eˣ − C, so eˣ + e^(−y) = C.
-
4. For dy/dx = (2x + 3y − 1)², the substitution z = 2x + 3y − 1 gives which equation?
- dz/dx = 3 + 2z²
- dz/dx = 2 + 3z²
- dz/dx = 2 + z²
- dz/dx = 3z² − 2
Show answer
Answer: B. dz/dx = 2 + 3 dy/dx = 2 + 3z². This is separable: dz/(2 + 3z²) = dx.
-
5. Which function is a solution of x y′ = 3y?
- y = 3x
- y = x³ + 1
- y = 5x³
- y = e^(3x)
Show answer
Answer: C. For y = 5x³: y′ = 15x², so x y′ = 15x³ = 3(5x³) = 3y. For y = 3x, x y′ = 3x but 3y = 9x; for y = x³ + 1, x y′ = 3x³ but 3y = 3x³ + 3; for y = e^(3x), x y′ = 3x e^(3x) ≠ 3e^(3x).
Sign in to keep track of the lessons you finish.