Skip to content
Family Table Math
Auto

Homogeneous Differential Equations

Some differential equations can’t be separated as they stand, like dydx=x2+y2xy\dfrac{dy}{dx} = \dfrac{x^2 + y^2}{xy}. But if the right side depends only on the ratio yx\dfrac{y}{x}, one clever substitution, y=vxy = vx, turns the equation into a separable one. This is one of the three exact solving methods in IB Mathematics AA HL (with separation of variables and the integrating factor), so you need to recognize when it applies and carry it through cleanly.

A first-order differential equation is homogeneous if it can be written as

dydx=f ⁣(yx)\frac{dy}{dx} = f\!\left(\frac{y}{x}\right)

that is, the right side is a function of yx\dfrac{y}{x} alone. For example:

EquationRewritten in terms of y/xHomogeneous?
dydx=x+yx\dfrac{dy}{dx} = \dfrac{x + y}{x}1+yx1 + \dfrac{y}{x}Yes
dydx=x2+y2xy\dfrac{dy}{dx} = \dfrac{x^2 + y^2}{xy}xy+yx\dfrac{x}{y} + \dfrac{y}{x}Yes
dydx=yx+cos⁡2 ⁣(yx)\dfrac{dy}{dx} = \dfrac{y}{x} + \cos^2\!\left(\dfrac{y}{x}\right)already in that formYes
dydx=x+y2x\dfrac{dy}{dx} = \dfrac{x + y^2}{x}1+y2x1 + \dfrac{y^2}{x}, which is not a function of y/xNo

A quick way to spot one: if the right side is a fraction whose top and bottom are polynomials in which every term has the same total degree (like x2x^2, xyxy, y2y^2, all degree 2), divide the top and bottom by xx to that power. Everything turns into powers of yx\dfrac{y}{x}.

(This use of the word “homogeneous” is different from “homogeneous linear equation” that you may meet in other books. In the IB AA course it means exactly the form above.)

Let v=yxv = \dfrac{y}{x}, so y=vxy = vx, where vv is a function of xx. Differentiate with the product rule:

dydx=v+x dvdx\frac{dy}{dx} = v + x\,\frac{dv}{dx}

Substitute both into dydx=f(v)\dfrac{dy}{dx} = f(v):

v+x dvdx=f(v)⇒x dvdx=f(v)−vv + x\,\frac{dv}{dx} = f(v) \quad\Rightarrow\quad x\,\frac{dv}{dx} = f(v) - v

The new equation in vv and xx is separable:

∫1f(v)−v dv=∫1x dx=ln⁡∣x∣+C\int \frac{1}{f(v) - v}\,dv = \int \frac{1}{x}\,dx = \ln|x| + C
  1. Check that the equation is homogeneous, and write the right side as f ⁣(yx)f\!\left(\dfrac{y}{x}\right).
  2. Substitute y=vxy = vx and dydx=v+xdvdx\dfrac{dy}{dx} = v + x\dfrac{dv}{dx}. The vv terms should simplify, leaving xdvdx=f(v)−vx\dfrac{dv}{dx} = f(v) - v.
  3. Separate and integrate. You may need partial fractions, a substitution, or a standard integral such as ∫11+v2 dv=arctan⁡v+C\displaystyle\int \frac{1}{1 + v^2}\,dv = \arctan v + C.
  4. Back-substitute v=yxv = \dfrac{y}{x} to get the general solution in terms of xx and yy.
  5. Use the initial condition (if any) to find CC, giving a particular solution. Make yy the subject if the question asks for it, and keep the branch that passes through the given point.

Never forget step 4: an answer containing vv is not finished.

Find the general solution of dydx=x+yx\dfrac{dy}{dx} = \dfrac{x + y}{x} for x>0x \gt 0. Then find the particular solution with y=2y = 2 when x=1x = 1.

Solution. The right side is 1+yx1 + \dfrac{y}{x}, so the equation is homogeneous with f(v)=1+vf(v) = 1 + v. Let y=vxy = vx:

v+xdvdx=1+vxdvdx=1∫dv=∫1x dxv=ln⁡x+C\begin{aligned} v + x\frac{dv}{dx} &= 1 + v \\ x\frac{dv}{dx} &= 1 \\ \int dv &= \int \frac{1}{x}\,dx \\ v &= \ln x + C \end{aligned}

Back-substitute v=yxv = \dfrac{y}{x} and multiply by xx:

y=xln⁡x+Cxy = x\ln x + Cx

For the particular solution, 2=1⋅ln⁡1+C(1)=C2 = 1 \cdot \ln 1 + C(1) = C, so

y=xln⁡x+2xy = x\ln x + 2x

Check: dydx=ln⁡x+1+2=ln⁡x+3\dfrac{dy}{dx} = \ln x + 1 + 2 = \ln x + 3, and x+yx=x+xln⁡x+2xx=ln⁡x+3\dfrac{x + y}{x} = \dfrac{x + x\ln x + 2x}{x} = \ln x + 3. ✓

Solution curves y = x ln x + Cx of dy/dx = 1 + y/x for x > 0. All of them start at the origin. The particular solution with C = 2 passes through (1, 2). 1 2 −2 2 4 6 8 (1, 2) C = 2 C = −2
Solutions of dydx=1+yx\frac{dy}{dx} = 1 + \frac{y}{x}: the general solution y=xln⁡x+Cxy = x\ln x + Cx is a family of curves, and the initial condition picks out C=2C = 2.

Example 2: A particular solution with a square root

Section titled “Example 2: A particular solution with a square root”

Solve dydx=x2+y2xy\dfrac{dy}{dx} = \dfrac{x^2 + y^2}{xy} for x>0x \gt 0, given that y=2y = 2 when x=1x = 1. Give yy in terms of xx.

Solution. Divide the top and bottom by x2x^2: dydx=1+(y/x)2y/x\dfrac{dy}{dx} = \dfrac{1 + (y/x)^2}{y/x}, so f(v)=1+v2vf(v) = \dfrac{1 + v^2}{v}. Then

f(v)−v=1+v2v−v2v=1vf(v) - v = \frac{1 + v^2}{v} - \frac{v^2}{v} = \frac{1}{v}

So xdvdx=1vx\dfrac{dv}{dx} = \dfrac{1}{v}. Separate and integrate:

∫v dv=∫1x dx⇒v22=ln⁡x+C\int v\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \frac{v^2}{2} = \ln x + C

Back-substitute and multiply by 2x22x^2 (renaming 2C2C as CC):

y2=2x2ln⁡x+Cx2y^2 = 2x^2\ln x + Cx^2

At (1,2)(1, 2): 4=0+C4 = 0 + C, so C=4C = 4 and y2=x2(2ln⁡x+4)y^2 = x^2(2\ln x + 4). Since y=2>0y = 2 \gt 0 at the start, take the positive root:

y=x2ln⁡x+4y = x\sqrt{2\ln x + 4}

This is defined while 2ln⁡x+4>02\ln x + 4 \gt 0, that is, for x>e−2≈0.135x \gt e^{-2} \approx 0.135.

Solve x2dydx=y2+2xyx^2\dfrac{dy}{dx} = y^2 + 2xy, given that y=1y = 1 when x=1x = 1.

Solution. Divide by x2x^2: dydx=(yx)2+2(yx)\dfrac{dy}{dx} = \left(\dfrac{y}{x}\right)^2 + 2\left(\dfrac{y}{x}\right), so f(v)=v2+2vf(v) = v^2 + 2v. With y=vxy = vx:

xdvdx=v2+2v−v=v2+v=v(v+1)x\frac{dv}{dx} = v^2 + 2v - v = v^2 + v = v(v + 1)

Separate, and split with partial fractions: 1v(v+1)=1v−1v+1\dfrac{1}{v(v + 1)} = \dfrac{1}{v} - \dfrac{1}{v + 1}.

∫(1v−1v+1)dv=∫1x dxln⁡∣v∣−ln⁡∣v+1∣=ln⁡∣x∣+Cvv+1=Axexponentiate; A=±eC\begin{aligned} \int \left(\frac{1}{v} - \frac{1}{v + 1}\right) dv &= \int \frac{1}{x}\,dx \\ \ln|v| - \ln|v + 1| &= \ln|x| + C \\ \frac{v}{v + 1} &= Ax && \text{exponentiate; } A = \pm e^C \end{aligned}

Back-substitute: vv+1=y/xy/x+1=yy+x\dfrac{v}{v + 1} = \dfrac{y/x}{y/x + 1} = \dfrac{y}{y + x}. At (1,1)(1, 1): 12=A\dfrac{1}{2} = A. So

yy+x=x2⇒2y=xy+x2⇒y(2−x)=x2⇒y=x22−x\frac{y}{y + x} = \frac{x}{2} \quad\Rightarrow\quad 2y = xy + x^2 \quad\Rightarrow\quad y(2 - x) = x^2 \quad\Rightarrow\quad y = \frac{x^2}{2 - x}

Check at x=1x = 1: y=11=1y = \dfrac{1}{1} = 1. ✓ The solution has a vertical asymptote at x=2x = 2, so the solution through (1,1)(1, 1) is valid for x<2x \lt 2 (the side of the asymptote that contains x=1x = 1).

Find the particular solution of dydx=yx+cos⁡2 ⁣(yx)\dfrac{dy}{dx} = \dfrac{y}{x} + \cos^2\!\left(\dfrac{y}{x}\right), x>0x \gt 0, with y=π4y = \dfrac{\pi}{4} when x=1x = 1.

Solution. Here f(v)=v+cos⁡2vf(v) = v + \cos^2 v, so xdvdx=cos⁡2vx\dfrac{dv}{dx} = \cos^2 v. Separate, using 1cos⁡2v=sec⁡2v\dfrac{1}{\cos^2 v} = \sec^2 v:

∫sec⁡2v dv=∫1x dx⇒tan⁡v=ln⁡x+C\int \sec^2 v\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \tan v = \ln x + C

Back-substitute: tan⁡ ⁣(yx)=ln⁡x+C\tan\!\left(\dfrac{y}{x}\right) = \ln x + C. At x=1x = 1, y=π4y = \dfrac{\pi}{4}: tan⁡π4=1=0+C\tan\dfrac{\pi}{4} = 1 = 0 + C, so C=1C = 1. Then

yx=arctan⁡(ln⁡x+1)⇒y=xarctan⁡(ln⁡x+1)\frac{y}{x} = \arctan(\ln x + 1) \quad\Rightarrow\quad y = x\arctan(\ln x + 1)

(Angles are in radians, as always in calculus.)

Writing dy/dx = x dv/dx. If y=vxy = vx, both vv and xx change, so you need the product rule: dydx=v+xdvdx\dfrac{dy}{dx} = v + x\dfrac{dv}{dx}. Dropping the vv means the vv terms won’t cancel and the equation won’t separate.

Forgetting to subtract v. After substituting you get xdvdx=f(v)−vx\dfrac{dv}{dx} = f(v) - v, not f(v)f(v). In Example 2 that subtraction is what made 1+v2v\dfrac{1 + v^2}{v} collapse to 1v\dfrac{1}{v}.

Leaving the answer in terms of v. The question is about xx and yy. Always replace vv with yx\dfrac{y}{x} before you finish, and before you use the initial condition (or substitute v=y0x0v = \dfrac{y_0}{x_0} if you prefer to find CC earlier).

Using the initial condition before integrating. The condition is about the solution curve, so it can only find CC after you have integrated. Plugging numbers into the differential equation itself tells you a slope, not the constant.

Mishandling the constant. After ln⁡∣v∣−ln⁡∣v+1∣=ln⁡∣x∣+C\ln|v| - \ln|v + 1| = \ln|x| + C, exponentiating gives vv+1=Ax\dfrac{v}{v + 1} = Ax, not vv+1=x+A\dfrac{v}{v + 1} = x + A. Combine the logs first, then exponentiate.

Taking the wrong square root. When you solve y2=…y^2 = \ldots, choose the sign that matches the initial condition (positive yy in Example 2) and say where the solution is defined.

1. (Warm-up) Decide whether each differential equation is homogeneous. If it is, write the right side as a function of v=yxv = \dfrac{y}{x}.

  • (a) dydx=x2+y22xy\dfrac{dy}{dx} = \dfrac{x^2 + y^2}{2xy}
  • (b) dydx=x+y2x\dfrac{dy}{dx} = \dfrac{x + y^2}{x}
  • (c) dydx=3y−xx+y\dfrac{dy}{dx} = \dfrac{3y - x}{x + y}
Solution

(a) Every term on top and bottom has degree 2. Divide by x2x^2: 1+v22v\dfrac{1 + v^2}{2v}. Homogeneous.

(b) The top has terms of degree 1 and 2, so dividing can’t make everything a function of vv: x+y2x=1+y2x=1+v2x\dfrac{x + y^2}{x} = 1 + \dfrac{y^2}{x} = 1 + v^2 x, which still contains xx. Not homogeneous.

(c) Every term has degree 1. Divide by xx: 3v−11+v\dfrac{3v - 1}{1 + v}. Homogeneous.

2. (Warm-up) Show that the substitution y=vxy = vx turns dydx=x+2yx\dfrac{dy}{dx} = \dfrac{x + 2y}{x} into xdvdx=1+vx\dfrac{dv}{dx} = 1 + v. Hence find the general solution, for x>0x \gt 0.

Solution

The right side is 1+2v1 + 2v. With dydx=v+xdvdx\dfrac{dy}{dx} = v + x\dfrac{dv}{dx}:

v+xdvdx=1+2v⇒xdvdx=1+vv + x\frac{dv}{dx} = 1 + 2v \quad\Rightarrow\quad x\frac{dv}{dx} = 1 + v

Separate and integrate:

∫11+v dv=∫1x dx⇒ln⁡∣1+v∣=ln⁡x+C⇒1+v=Ax\int \frac{1}{1 + v}\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \ln|1 + v| = \ln x + C \quad\Rightarrow\quad 1 + v = Ax

Back-substitute: 1+yx=Ax1 + \dfrac{y}{x} = Ax, so y=Ax2−xy = Ax^2 - x.

Check: dydx=2Ax−1\dfrac{dy}{dx} = 2Ax - 1 and x+2(Ax2−x)x=2Ax−1\dfrac{x + 2(Ax^2 - x)}{x} = 2Ax - 1. ✓

3. (Warm-up) Find the general solution of dydx=xy+y2x2\dfrac{dy}{dx} = \dfrac{xy + y^2}{x^2}, x>0x \gt 0.

Solution

f(v)=v+v2f(v) = v + v^2, so xdvdx=v2x\dfrac{dv}{dx} = v^2. Then

∫v−2 dv=∫1x dx⇒−1v=ln⁡x+C⇒v=−1ln⁡x+C\int v^{-2}\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad -\frac{1}{v} = \ln x + C \quad\Rightarrow\quad v = -\frac{1}{\ln x + C}

So y=−xln⁡x+Cy = -\dfrac{x}{\ln x + C}.

4. (Core) Solve xdydx=y+2xx\dfrac{dy}{dx} = y + 2x, x>0x \gt 0, given that y=3y = 3 when x=1x = 1.

Solution

Divide by xx: dydx=yx+2\dfrac{dy}{dx} = \dfrac{y}{x} + 2, so f(v)=v+2f(v) = v + 2 and xdvdx=2x\dfrac{dv}{dx} = 2.

∫dv=∫2x dx⇒v=2ln⁡x+C⇒y=2xln⁡x+Cx\int dv = \int \frac{2}{x}\,dx \quad\Rightarrow\quad v = 2\ln x + C \quad\Rightarrow\quad y = 2x\ln x + Cx

At (1,3)(1, 3): 3=0+C3 = 0 + C, so y=2xln⁡x+3xy = 2x\ln x + 3x.

5. (Core) Solve dydx=x2+3y22xy\dfrac{dy}{dx} = \dfrac{x^2 + 3y^2}{2xy}, x>0x \gt 0, given that y=1y = 1 when x=1x = 1. Give yy in terms of xx, and state where the solution is defined.

Solution

f(v)=1+3v22vf(v) = \dfrac{1 + 3v^2}{2v}, so

xdvdx=1+3v22v−v=1+3v2−2v22v=1+v22vx\frac{dv}{dx} = \frac{1 + 3v^2}{2v} - v = \frac{1 + 3v^2 - 2v^2}{2v} = \frac{1 + v^2}{2v}

Separate. The top of 2v1+v2\dfrac{2v}{1 + v^2} is the derivative of the bottom:

∫2v1+v2 dv=∫1x dx⇒ln⁡(1+v2)=ln⁡x+C⇒1+v2=Ax\int \frac{2v}{1 + v^2}\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \ln(1 + v^2) = \ln x + C \quad\Rightarrow\quad 1 + v^2 = Ax

Back-substitute and multiply by x2x^2: x2+y2=Ax3x^2 + y^2 = Ax^3. At (1,1)(1, 1): 2=A2 = A. So y2=2x3−x2=x2(2x−1)y^2 = 2x^3 - x^2 = x^2(2x - 1), and with y>0y \gt 0,

y=x2x−1y = x\sqrt{2x - 1}

defined for x>12x \gt \dfrac{1}{2} (the solution must be differentiable on an interval containing x=1x = 1).

6. (Core) Consider dydx=y2−x22xy\dfrac{dy}{dx} = \dfrac{y^2 - x^2}{2xy}.

  • (a) Show that the general solution can be written x2+y2=Axx^2 + y^2 = Ax, and describe these curves.
  • (b) Find the solution curve that passes through (1,1)(1, 1).
Solution

(a) f(v)=v2−12vf(v) = \dfrac{v^2 - 1}{2v}, so

xdvdx=v2−12v−v=v2−1−2v22v=−1+v22vx\frac{dv}{dx} = \frac{v^2 - 1}{2v} - v = \frac{v^2 - 1 - 2v^2}{2v} = -\frac{1 + v^2}{2v}∫2v1+v2 dv=−∫1x dx⇒ln⁡(1+v2)=−ln⁡∣x∣+C⇒1+v2=Ax\int \frac{2v}{1 + v^2}\,dv = -\int \frac{1}{x}\,dx \quad\Rightarrow\quad \ln(1 + v^2) = -\ln|x| + C \quad\Rightarrow\quad 1 + v^2 = \frac{A}{x}

Multiply by x2x^2: x2+y2=Axx^2 + y^2 = Ax. Completing the square, (x−A2)2+y2=A24\left(x - \dfrac{A}{2}\right)^2 + y^2 = \dfrac{A^2}{4}: circles with centre (A2,0)\left(\dfrac{A}{2}, 0\right) on the xx-axis, all passing through the origin.

(b) At (1,1)(1, 1): 2=A2 = A, so x2+y2=2xx^2 + y^2 = 2x, the circle (x−1)2+y2=1(x - 1)^2 + y^2 = 1. As a function, the solution through (1,1)(1, 1) is the upper half, y=2x−x2y = \sqrt{2x - x^2} for 0<x<20 \lt x \lt 2.

7. (Core) Solve dydx=yx+tan⁡ ⁣(yx)\dfrac{dy}{dx} = \dfrac{y}{x} + \tan\!\left(\dfrac{y}{x}\right), x>0x \gt 0, given that y=π6y = \dfrac{\pi}{6} when x=1x = 1.

Solution

xdvdx=tan⁡vx\dfrac{dv}{dx} = \tan v. Separate, using 1tan⁡v=cos⁡vsin⁡v\dfrac{1}{\tan v} = \dfrac{\cos v}{\sin v}:

∫cos⁡vsin⁡v dv=∫1x dx⇒ln⁡∣sin⁡v∣=ln⁡x+C⇒sin⁡v=Ax\int \frac{\cos v}{\sin v}\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \ln|\sin v| = \ln x + C \quad\Rightarrow\quad \sin v = Ax

So sin⁡ ⁣(yx)=Ax\sin\!\left(\dfrac{y}{x}\right) = Ax. At (1,π6)(1, \tfrac{\pi}{6}): sin⁡π6=12=A\sin\dfrac{\pi}{6} = \dfrac{1}{2} = A. Then

sin⁡ ⁣(yx)=x2⇒y=xarcsin⁡ ⁣(x2)\sin\!\left(\frac{y}{x}\right) = \frac{x}{2} \quad\Rightarrow\quad y = x\arcsin\!\left(\frac{x}{2}\right)

valid for 0<x<20 \lt x \lt 2.

8. (Challenge) Show that the solution of dydx=y−xy+x\dfrac{dy}{dx} = \dfrac{y - x}{y + x} through the point (1,0)(1, 0) satisfies

12ln⁡(x2+y2)+arctan⁡ ⁣(yx)=0\frac{1}{2}\ln\left(x^2 + y^2\right) + \arctan\!\left(\frac{y}{x}\right) = 0
Solution

f(v)=v−1v+1f(v) = \dfrac{v - 1}{v + 1}, so

xdvdx=v−1v+1−v=v−1−v2−vv+1=−v2+1v+1x\frac{dv}{dx} = \frac{v - 1}{v + 1} - v = \frac{v - 1 - v^2 - v}{v + 1} = -\frac{v^2 + 1}{v + 1}

Separate, and split the integrand into two standard pieces:

∫(vv2+1+1v2+1)dv=−∫1x dx\int \left(\frac{v}{v^2 + 1} + \frac{1}{v^2 + 1}\right) dv = -\int \frac{1}{x}\,dx12ln⁡(v2+1)+arctan⁡v=−ln⁡∣x∣+C\frac{1}{2}\ln(v^2 + 1) + \arctan v = -\ln|x| + C

Move ln⁡∣x∣=12ln⁡x2\ln|x| = \dfrac{1}{2}\ln x^2 to the left and combine:

12ln⁡(x2(v2+1))+arctan⁡v=C⇒12ln⁡(x2+y2)+arctan⁡ ⁣(yx)=C\frac{1}{2}\ln\big(x^2(v^2 + 1)\big) + \arctan v = C \quad\Rightarrow\quad \frac{1}{2}\ln(x^2 + y^2) + \arctan\!\left(\frac{y}{x}\right) = C

since x2v2=y2x^2 v^2 = y^2. At (1,0)(1, 0): 12ln⁡1+arctan⁡0=0=C\dfrac{1}{2}\ln 1 + \arctan 0 = 0 = C. ✓ (This solution can’t be made explicit, so leaving it in this implicit form is fine.)

9. (Challenge) Solve x2dydx=x2+xy+y2x^2\dfrac{dy}{dx} = x^2 + xy + y^2, x>0x \gt 0, given that y=0y = 0 when x=1x = 1. Find the largest interval containing x=1x = 1 on which the solution is defined, giving the endpoints exactly.

Solution

Divide by x2x^2: f(v)=1+v+v2f(v) = 1 + v + v^2, so xdvdx=1+v2x\dfrac{dv}{dx} = 1 + v^2.

∫11+v2 dv=∫1x dx⇒arctan⁡v=ln⁡x+C\int \frac{1}{1 + v^2}\,dv = \int \frac{1}{x}\,dx \quad\Rightarrow\quad \arctan v = \ln x + C

At (1,0)(1, 0), v=0v = 0: arctan⁡0=0=C\arctan 0 = 0 = C. So arctan⁡ ⁣(yx)=ln⁡x\arctan\!\left(\dfrac{y}{x}\right) = \ln x, and

y=xtan⁡(ln⁡x)y = x\tan(\ln x)

tan⁡\tan is defined on −π2<ln⁡x<π2-\dfrac{\pi}{2} \lt \ln x \lt \dfrac{\pi}{2} around ln⁡1=0\ln 1 = 0, so the solution is defined for

e−π/2<x<eπ/2e^{-\pi/2} \lt x \lt e^{\pi/2}

that is, about 0.208<x<4.810.208 \lt x \lt 4.81 (to 3 s.f.). At either end, yy has a vertical asymptote.