Substitution for Homogeneous Equations
A homogeneous differential equation is a first-order equation that can be written as dy/dx = F(y/x), so the slope depends only on the ratio y/x. The substitution y = vx, with dy/dx = v + x dv/dx, turns it into a separable equation in v and x. Solve it, then replace v with y/x.
Before this lesson: Separable Differential Equations, Product Rule and Bernoulli Equations
The idea: slopes that depend only on direction
In dy/dx = 1 + y/x, the slope at (1, 1) is 2, and so is the slope at (2, 2), (3, 3) and every other point on the line y = x. The slope changes only when the ratio y/x changes, that is, when you move to a different ray from the origin.
So the natural unknown is not y but the ratio v = y/x. Writing y = vx swaps the old unknown for this new one, and the equation splits into a v-part and an x-part that you can separate.
One warning about the name: “homogeneous” has a second meaning in differential equations. A linear equation like y″ + y = 0, with zero on the right side, is also called homogeneous. That is a different idea, covered in Second-Order Homogeneous Linear Equations.
Homogeneous differential equations: the y = vx substitution
\dfrac{dy}{dx} = F\!\left(\dfrac{y}{x}\right)Here is why the substitution y = vx always gives a separable equation.
y = vx
Let v = y/x, so y = vx, where v is a function of x.
\dfrac{dy}{dx} = v + x\dfrac{dv}{dx}Differentiate vx with the product rule.
v + x\dfrac{dv}{dx} = F(v)Substitute into dy/dx = F(y/x).
x\dfrac{dv}{dx} = F(v) - vSubtract v from both sides.
\dfrac{dv}{F(v) - v} = \dfrac{dx}{x}Separate the variables (where F(v) ≠ v).
How to test for a homogeneous equation
Replace x with tx and y with ty in f(x, y), the right side of dy/dx = f(x, y). If every t cancels, so that f(tx, ty) = f(x, y), the equation is homogeneous. For an equation written as M(x, y) dx + N(x, y) dy = 0, it is homogeneous when M and N are homogeneous polynomials of the same degree: every term has the same total power of x and y.
| Right side f(x, y) | f(tx, ty) | Homogeneous? |
|---|---|---|
| \dfrac{x + y}{x} | \dfrac{tx + ty}{tx} = \dfrac{x + y}{x} | Yes |
| \dfrac{x^2 + y^2}{2xy} | \dfrac{t^2(x^2 + y^2)}{t^2(2xy)} | Yes |
| \dfrac{y}{x} + e^{y/x} | \dfrac{ty}{tx} + e^{ty/tx} | Yes |
| \dfrac{x + y^2}{x} | \dfrac{tx + t^2y^2}{tx} | No: the powers don’t match |
| x + y | t(x + y) | No: a factor t is left over |
How to solve a homogeneous differential equation
- Write the equation as dy/dx = f(x, y) and check that f(tx, ty) = f(x, y).
- Rewrite the right side in terms of y/x, often by dividing the top and bottom by a power of x.
- Substitute y = vx and dy/dx = v + x dv/dx.
- Subtract v from both sides and separate the variables: dv/(F(v) − v) = dx/x.
- Integrate both sides, then replace v with y/x.
- Use the initial condition, if given. Check whether any roots of F(v) = v give extra solutions y = vx that were lost when you divided.
Homogeneous differential equation examples
Example 1: The slope field equation
Solve dy/dx = (x + y)/x for positive x.
\dfrac{dy}{dx} = 1 + \dfrac{y}{x}Divide each term of the numerator by x. The right side depends only on y/x.
v + x\dfrac{dv}{dx} = 1 + vSubstitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = 1Subtract v from both sides.
dv = \dfrac{dx}{x}Separate the variables.
v = \ln x + C
Integrate both sides (x is positive).
\dfrac{y}{x} = \ln x + CReplace v with y/x.
y = x\ln x + Cx
Multiply both sides by x.
Answer: y = x ln x + Cx. With C = 1 this is the curve through (1, 1) in the slope field above.
Example 2: An initial-value problem
Solve (x² + y²) dx − 2xy dy = 0 with y(1) = 2.
First test it. Replacing x with tx and y with ty in (x² + y²)/(2xy) gives t²(x² + y²)/(t²(2xy)), and the t² cancels, so the equation is homogeneous. Both M = x² + y² and N = −2xy have degree 2.
2xy\,dy = (x^2 + y^2)\,dx
Add 2xy dy to both sides.
\dfrac{dy}{dx} = \dfrac{x^2 + y^2}{2xy}Divide both sides by 2xy dx.
\dfrac{dy}{dx} = \dfrac{1 + (y/x)^2}{2(y/x)}Divide the top and bottom by x².
v + x\dfrac{dv}{dx} = \dfrac{1 + v^2}{2v}Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = \dfrac{1 + v^2}{2v} - \dfrac{2v^2}{2v}Subtract v, written as 2v²/(2v), from both sides.
x\dfrac{dv}{dx} = \dfrac{1 - v^2}{2v}Combine the fractions.
\dfrac{2v}{1 - v^2}\,dv = \dfrac{dx}{x}Separate the variables.
-\ln\lvert 1 - v^2\rvert = \ln\lvert x\rvert + C
Integrate both sides. On the left, 2v is −1 times the derivative of 1 − v² (see integrals that give natural logarithms).
\ln\lvert 1 - v^2\rvert = -\ln\lvert x\rvert - C
Multiply both sides by −1.
1 - v^2 = \dfrac{K}{x}Exponentiate both sides and let K = ±e^(−C).
1 - \dfrac{y^2}{x^2} = \dfrac{K}{x}Replace v with y/x.
x^2 - y^2 = Kx
Multiply every term by x².
1 - 4 = K
Substitute x = 1 and y = 2.
K = -3
Simplify.
x^2 - y^2 = -3x
Substitute K = −3.
y^2 = x^2 + 3x
Add y² + 3x to both sides.
y = \sqrt{x^2 + 3x}Take the positive square root, since y(1) = 2 is positive.
Answer: y = √(x² + 3x) for positive x. Check: at x = 1, √(1 + 3) = 2.
Example 3: A lost solution
Solve dy/dx = (y² + xy)/x² for positive x.
\dfrac{dy}{dx} = \dfrac{y^2}{x^2} + \dfrac{y}{x}Split the fraction. Each term depends only on y/x.
v + x\dfrac{dv}{dx} = v^2 + vSubstitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = v^2Subtract v from both sides.
v^{-2}\,dv = \dfrac{dx}{x}Separate the variables (for v ≠ 0).
-v^{-1} = \ln x + CIntegrate both sides with the power rule in reverse.
v = -\dfrac{1}{\ln x + C}Take the reciprocal of both sides and multiply by −1.
y = -\dfrac{x}{\ln x + C}Multiply both sides by x, since y = vx.
Answer: y = −x/(ln x + C). We divided by v², so check v = 0: it makes F(v) − v = v² equal 0, and y = 0 · x = 0 does solve the equation. So y = 0 is a second, lost solution. This equation is also a Bernoulli equation with n = 2, and that method gives the same answer.
Example 4: An exponential of y/x
Solve dy/dx = y/x + e^(y/x) with y(1) = 0.
v + x\dfrac{dv}{dx} = v + e^{v}Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = e^{v}Subtract v from both sides.
e^{-v}\,dv = \dfrac{dx}{x}Divide both sides by x eᵛ and multiply by dx.
-e^{-v} = \ln x + CIntegrate both sides (x is positive near x = 1).
-e^{0} = \ln 1 + CAt x = 1, v = 0/1 = 0.
C = -1
Since e⁰ = 1 and ln 1 = 0.
e^{-v} = 1 - \ln xSubstitute C = −1 and multiply both sides by −1.
-v = \ln(1 - \ln x)
Take the natural log of both sides.
y = -x\ln(1 - \ln x)
Multiply both sides by −x, since y = vx.
Answer: y = −x ln(1 − ln x). It is defined only while 1 − ln x is positive, so the solution lives on x between 0 and e.
Example 5: A boat crossing a river (word problem)
A boat crosses a river 100 m wide to reach a dock on the far bank. Put the dock at the origin and the boat’s start at (100, 0). The current flows at 1 m/s in the positive y-direction, and the boat moves at 2 m/s through the water, always pointed at the dock. Dividing dy/dt by dx/dt shows that the path satisfies dy/dx = y/x − ½√(1 + (y/x)²) for positive x. Find the path and the boat’s farthest drift downstream.
v + x\dfrac{dv}{dx} = v - \tfrac{1}{2}\sqrt{1 + v^2}Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = -\tfrac{1}{2}\sqrt{1 + v^2}Subtract v from both sides.
\dfrac{dv}{\sqrt{1 + v^2}} = -\dfrac{1}{2}\cdot\dfrac{dx}{x}Separate the variables.
\ln\!\left(v + \sqrt{1 + v^2}\right) = -\tfrac{1}{2}\ln x + CIntegrate both sides. The left integral comes from trigonometric substitution.
0 = -\tfrac{1}{2}\ln 100 + CAt x = 100, y = 0, so v = 0 and the left side is ln 1 = 0.
C = \tfrac{1}{2}\ln 100Add ½ ln 100 to both sides.
C = \ln 10
Use the power property: ½ ln 100 = ln √100 (see properties of logarithms).
\ln\!\left(v + \sqrt{1 + v^2}\right) = \ln 10 - \tfrac{1}{2}\ln xSubstitute C = ln 10.
\ln\!\left(v + \sqrt{1 + v^2}\right) = \ln\dfrac{10}{\sqrt{x}}Combine the logs: ½ ln x = ln √x, and ln a − ln b = ln(a/b).
v + \sqrt{1 + v^2} = \dfrac{10}{\sqrt{x}}Exponentiate both sides. Call the right side A.
\sqrt{1 + v^2} = A - vSubtract v from both sides.
1 + v^2 = A^2 - 2Av + v^2
Square both sides.
1 = A^2 - 2Av
Subtract v² from both sides.
2Av = A^2 - 1
Add 2Av − 1 to both sides.
v = \dfrac{1}{2}\left(A - \dfrac{1}{A}\right)Divide both sides by 2A.
v = \dfrac{1}{2}\left(\dfrac{10}{\sqrt{x}} - \dfrac{\sqrt{x}}{10}\right)Substitute A = 10/√x.
y = 5\sqrt{x} - \dfrac{x\sqrt{x}}{20}Multiply both sides by x, since y = vx.
\dfrac{dy}{dx} = \dfrac{5}{2\sqrt{x}} - \dfrac{3\sqrt{x}}{40}To find the farthest drift, differentiate with the power rule.
\dfrac{5}{2\sqrt{x}} = \dfrac{3\sqrt{x}}{40}Set dy/dx equal to 0 and add 3√x/40 to both sides.
200 = 6x
Multiply both sides by 80√x.
x = \tfrac{100}{3} \approx 33.3Divide both sides by 6.
y = 5\sqrt{\tfrac{100}{3}} - \dfrac{\tfrac{100}{3}\sqrt{\tfrac{100}{3}}}{20} \approx 19.2Substitute into the path equation and use a calculator.
Answer: the path is y = 5√x − x√x/20. The boat drifts at most about 19.2 m downstream, when it is about 33.3 m from the dock’s bank, and it still reaches the dock, since y = 0 when x = 0.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Dropping the x dv/dx term | Writing dy/dx = dv/dx after y = vx | By the product rule, \dfrac{dy}{dx} = v + x\dfrac{dv}{dx}. |
| Using y = vx on an equation that isn’t homogeneous | Substituting into \dfrac{dy}{dx} = \dfrac{x + y^2}{x} | Test first: f(tx, ty) = \dfrac{tx + t^2y^2}{tx} still has a t, so the method fails. |
| Stopping at v | Giving v = \ln x + C as the answer | Replace v with y/x: y = x\ln x + Cx. |
| Losing solutions | Dividing by v^2 and never checking v = 0 | Solve F(v) = v; each root gives a solution y = vx. |
| Forgetting absolute values | Writing \ln(1 - v^2) when 1 - v^2 can be negative | Use \ln\lvert 1 - v^2\rvert, then let the constant K be positive or negative. |
| Mixing up the two meanings of homogeneous | Using y = vx on y'' + y = 0 | That equation is homogeneous in the linear sense; it needs the characteristic equation instead. |
Related methods
Equations in M dx + N dy = 0 form
Many textbooks write these equations as M(x, y) dx + N(x, y) dy = 0. Solve for dy/dx = −M/N first, as in Example 2. When N is simpler than M, the substitution x = uy, with dx/dy = u + y du/dy, can give easier integrals.
Other substitutions
The y = vx trick is one of several substitutions. Bernoulli equations use v = y^(1−n). An equation dy/dx = G(ax + by), such as dy/dx = (x + y)², becomes separable with u = ax + by. Some equations, like Example 2, are also exact differential equations after you multiply by an integrating factor, so there can be more than one route.
Checking the type first
Classifying differential equations helps you choose a method. Many homogeneous equations are nonlinear, so an integrating factor doesn’t apply, but the test f(tx, ty) = f(x, y) takes only a few seconds.
Practice problems
- Is f(x, y) = (x³ + y³)/(x²y) homogeneous? Use the t-test.
- Is dy/dx = (x + y + 1)/x homogeneous? Explain.
- Solve dy/dx = (x + 2y)/x for positive x.
- Solve dy/dx = (x² + 3y²)/(2xy) for positive x.
- Solve x² dy/dx = x² + xy + y² with y(1) = 0.
- Solve dy/dx = (y² − x²)/(2xy) with y(1) = 1.
- Solve dy/dx = y/x + tan(y/x) for positive x.
- Solve (x − y) dx + x dy = 0 for positive x, with y(1) = 3.
- A curve in the first quadrant passes through (1, 2). At each point, its slope equals the slope of the line from the origin to the point plus the reciprocal of that slope. Find the curve.
- A boat crosses a river 64 m wide, starting at (64, 0) and always pointed at a dock at the origin. It moves at 4 m/s through the water, and the current flows at 2 m/s in the positive y-direction, so dy/dx = y/x − ½√(1 + (y/x)²). Find the path and the farthest drift downstream.
Show answers
1.
f(tx, ty) = \dfrac{t^3x^3 + t^3y^3}{t^2x^2 \cdot ty}Replace x with tx and y with ty.
f(tx, ty) = \dfrac{t^3(x^3 + y^3)}{t^3x^2y}Factor t³ from the top and collect the powers of t on the bottom.
f(tx, ty) = \dfrac{x^3 + y^3}{x^2y} = f(x, y)Cancel t³.
Answer: yes, it is homogeneous (every term has degree 3)
2.
f(tx, ty) = \dfrac{tx + ty + 1}{tx}Replace x with tx and y with ty.
f(1, 1) = 3,\quad f(2, 2) = 2.5
The constant 1 gets no factor t, so the t’s can’t cancel. Points on the same ray give different slopes.
Answer: no, it is not homogeneous
3.
\dfrac{dy}{dx} = 1 + 2\cdot\dfrac{y}{x}Split the fraction.
v + x\dfrac{dv}{dx} = 1 + 2vSubstitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = 1 + vSubtract v from both sides.
\dfrac{dv}{1 + v} = \dfrac{dx}{x}Separate the variables.
\ln\lvert 1 + v\rvert = \ln x + C
Integrate both sides.
1 + v = Kx
Exponentiate both sides and let K = ±e^C.
v = Kx - 1
Subtract 1 from both sides.
y = Kx^2 - x
Multiply both sides by x.
Answer: y = Kx² − x
4.
v + x\dfrac{dv}{dx} = \dfrac{1 + 3v^2}{2v}Divide the top and bottom by x², then substitute y = vx.
x\dfrac{dv}{dx} = \dfrac{1 + v^2}{2v}Subtract v, written as 2v²/(2v), from both sides.
\dfrac{2v}{1 + v^2}\,dv = \dfrac{dx}{x}Separate the variables.
\ln(1 + v^2) = \ln x + C
Integrate both sides (1 + v² is positive).
1 + v^2 = Kx
Exponentiate both sides and let K = e^C.
x^2 + y^2 = Kx^3
Replace v with y/x and multiply every term by x².
Answer: x² + y² = Kx³
5.
\dfrac{dy}{dx} = 1 + \dfrac{y}{x} + \dfrac{y^2}{x^2}Divide every term by x².
v + x\dfrac{dv}{dx} = 1 + v + v^2Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = 1 + v^2Subtract v from both sides.
\dfrac{dv}{1 + v^2} = \dfrac{dx}{x}Separate the variables.
\arctan v = \ln x + C
Integrate both sides (see integrals that give inverse trig functions).
\arctan 0 = \ln 1 + C
At x = 1, v = 0/1 = 0.
C = 0
Both arctan 0 and ln 1 equal 0.
v = \tan(\ln x)
Take the tangent of both sides.
Answer: y = x tan(ln x)
6.
v + x\dfrac{dv}{dx} = \dfrac{v^2 - 1}{2v}Divide the top and bottom by x², then substitute y = vx.
x\dfrac{dv}{dx} = -\dfrac{1 + v^2}{2v}Subtract v, written as 2v²/(2v), from both sides.
\dfrac{2v}{1 + v^2}\,dv = -\dfrac{dx}{x}Separate the variables.
\ln(1 + v^2) = -\ln x + C
Integrate both sides.
1 + v^2 = \dfrac{K}{x}Exponentiate both sides and let K = e^C.
x^2 + y^2 = Kx
Replace v with y/x and multiply every term by x².
1 + 1 = K
Substitute x = 1 and y = 1.
x^2 + y^2 = 2x
Substitute K = 2.
Answer: x² + y² = 2x, or y = √(2x − x²), a circle through the origin
7.
v + x\dfrac{dv}{dx} = v + \tan vSubstitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = \tan vSubtract v from both sides.
\cot v\,dv = \dfrac{dx}{x}Separate the variables: 1/tan v = cot v.
\ln\lvert\sin v\rvert = \ln x + C
Integrate both sides.
\sin v = Kx
Exponentiate both sides and let K = ±e^C.
v = \arcsin(Kx)
Take the inverse sine of both sides.
Answer: y = x arcsin(Kx)
8.
x\,dy = (y - x)\,dx
Subtract (x − y) dx from both sides.
\dfrac{dy}{dx} = \dfrac{y}{x} - 1Divide both sides by x dx.
v + x\dfrac{dv}{dx} = v - 1Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = -1Subtract v from both sides.
v = -\ln x + C
Separate (dv = −dx/x) and integrate.
3 = 0 + C
At x = 1, v = 3/1 = 3 and ln 1 = 0.
v = 3 - \ln x
Substitute C = 3.
Answer: y = 3x − x ln x
9.
\dfrac{dy}{dx} = \dfrac{y}{x} + \dfrac{x}{y}Translate: slope y/x plus its reciprocal x/y.
v + x\dfrac{dv}{dx} = v + \dfrac{1}{v}Substitute y = vx and dy/dx = v + x dv/dx.
x\dfrac{dv}{dx} = \dfrac{1}{v}Subtract v from both sides.
v\,dv = \dfrac{dx}{x}Separate the variables.
\tfrac{1}{2}v^2 = \ln x + CIntegrate both sides.
\tfrac{1}{2}\cdot 4 = 0 + CAt (1, 2), v = 2/1 = 2.
v^2 = 2\ln x + 4
Substitute C = 2 and multiply both sides by 2.
Answer: y = x√(2 ln x + 4)
10.
\ln\!\left(v + \sqrt{1 + v^2}\right) = -\tfrac{1}{2}\ln x + CSubstitute y = vx, subtract v, separate and integrate, as in Example 5.
C = \tfrac{1}{2}\ln 64 = \ln 8At x = 64, v = 0, and ½ ln 64 = ln √64.
v + \sqrt{1 + v^2} = \dfrac{8}{\sqrt{x}}Substitute C, combine the logs and exponentiate.
v = \dfrac{1}{2}\left(\dfrac{8}{\sqrt{x}} - \dfrac{\sqrt{x}}{8}\right)Solve for v as in Example 5, with A = 8/√x.
y = 4\sqrt{x} - \dfrac{x\sqrt{x}}{16}Multiply both sides by x.
\dfrac{2}{\sqrt{x}} = \dfrac{3\sqrt{x}}{32}Set dy/dx = 2/√x − 3√x/32 equal to 0 and add 3√x/32 to both sides.
64 = 3x
Multiply both sides by 32√x.
x = \tfrac{64}{3} \approx 21.3Divide both sides by 3.
y \approx 12.3
Substitute into the path equation and use a calculator.
Answer: y = 4√x − x√x/16; the farthest drift is about 12.3 m, at about 21.3 m from the dock’s bank
Homogeneous differential equations FAQ
What is a homogeneous differential equation?
In first-order equations, it is one that can be written as dy/dx = F(y/x), so the right side depends only on the ratio y/x. In linear equations, “homogeneous” means something different: the side without y is zero.
How do you know if a differential equation is homogeneous?
Replace x with tx and y with ty in the right side of dy/dx = f(x, y). If the t’s all cancel, the equation is homogeneous. In M dx + N dy = 0 form, check that M and N have the same degree.
Why does the substitution y = vx work?
By the product rule, dy/dx = v + x dv/dx. The right side becomes F(v), so the equation becomes x dv/dx = F(v) − v, which is separable in v and x.
Can an equation be both homogeneous and Bernoulli?
Yes. dy/dx = (y² + xy)/x² in Example 3 is both, and either method gives y = −x/(ln x + C). Pick whichever substitution leads to easier integrals.
Summary
- A first-order equation is homogeneous when it can be written as dy/dx = F(y/x), or when f(tx, ty) = f(x, y).
- Substitute y = vx and dy/dx = v + x dv/dx.
- The result x dv/dx = F(v) − v is separable: dv/(F(v) − v) = dx/x.
- Integrate, then replace v with y/x and apply any initial condition.
- Roots of F(v) = v give extra straight-line solutions y = vx.
- Don’t confuse this with homogeneous linear equations, which have zero on the right side.
Previous lesson: Bernoulli Equations
Next lesson: Existence and Uniqueness Theorem
Back to the Differential Equations Index