Class 12 Maths, Worked in Full Past papersGet updates
Chapter 9 · Differential Equations

Example 10: Homogeneous: (x−y)dydx=x+2y(x - y)\frac{dy}{dx} = x + 2y

ExamplesHomogeneous differential equations · Section 9.4.2
The question

Show that the differential equation (x−y)dydx=x+2y(x - y)\dfrac{dy}{dx} = x + 2y is homogeneous and solve it.

Exam answer

For x≠yx \ne y⁠, the equation can be written as

dydx=x+2yx−y=F(x,y)\frac{dy}{dx} = \frac{x + 2y}{x - y} = F(x, y)

Then

F(λx,λy)=λ(x+2y)λ(x−y)=λ0⋅F(x,y)\begin{aligned} F(\lambda x, \lambda y) &= \frac{\lambda(x + 2y)}{\lambda(x - y)} \\ &= \lambda^0\cdot F(x, y) \end{aligned}

So FF is homogeneous of degree zero, and the equation is homogeneous.

Put y=vxy = vx⁠. Then dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠.

v+xdvdx=1+2v1−vxdvdx=1+2v1−v−v=v2+v+11−v\begin{aligned} v + x\frac{dv}{dx} &= \frac{1 + 2v}{1 - v} \\ x\frac{dv}{dx} &= \frac{1 + 2v}{1 - v} - v \\ &= \frac{v^2 + v + 1}{1 - v} \end{aligned}

Separating the variables,

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

Writing v−1=12(2v+1)−32v - 1 = \frac12(2v + 1) - \frac32 and integrating both sides,

12∫2v+1v2+v+1 dv−32∫dv(v+12)2+(32)2=−log⁡∣x∣+C1\begin{aligned} &\frac12\int\frac{2v + 1}{v^2 + v + 1}\,dv \\ &\quad - \frac32\int\frac{dv}{\left(v + \frac12\right)^2 + \left(\frac{\sqrt3}{2}\right)^2} \\ &= -\log|x| + C_1 \end{aligned}

Using ∫f′(v)f(v) dv=log⁡∣f(v)∣\int\frac{f'(v)}{f(v)}\,dv = \log|f(v)| and ∫dvv2+a2=1atan⁡−1va\int\frac{dv}{v^2 + a^2} = \frac1a\tan^{-1}\frac{v}{a}⁠,

12log⁡(v2+v+1)−32⋅23tan⁡−12v+13=−log⁡∣x∣+C1\begin{aligned} &\frac12\log(v^2 + v + 1) \\ &\quad - \frac32\cdot\frac{2}{\sqrt3}\tan^{-1}\frac{2v + 1}{\sqrt3} \\ &= -\log|x| + C_1 \end{aligned}

Since v2+v+1>0v^2 + v + 1 > 0 and log⁡∣x∣=12log⁡x2\log|x| = \frac12\log x^2⁠,

12log⁡(v2+v+1)+12log⁡x2=3tan⁡−12v+13+C1\begin{aligned} &\frac12\log(v^2 + v + 1) + \frac12\log x^2 \\ &= \sqrt3\tan^{-1}\frac{2v + 1}{\sqrt3} + C_1 \end{aligned}

Putting v=yxv = \frac{y}{x}⁠,

12log⁡[(y2x2+yx+1)x2]=3tan⁡−12y+x3x+C1\begin{aligned} &\frac12\log\left[\left(\frac{y^2}{x^2} + \frac{y}{x} + 1\right)x^2\right] \\ &= \sqrt3\tan^{-1}\frac{2y + x}{\sqrt3x} + C_1 \end{aligned}

Multiplying by 2 and writing C=2C1C = 2C_1⁠,

∴\therefore log⁡∣x2+xy+y2∣\log|x^2 + xy + y^2| =23tan⁡−1x+2y3x+C= 2\sqrt3\tan^{-1}\dfrac{x + 2y}{\sqrt3x} + C is the general solution.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Every term of x+2yx + 2y and of x−yx - y has degree 1, so the slope x+2yx−y\frac{x + 2y}{x - y} depends only on the ratio yx\frac{y}{x}⁠: scaling xx and yy together changes nothing. That makes the equation homogeneous, and the substitution y=vxy = vx turns it into a separable equation in vv and xx⁠. The vv-integral needs the two tools of Chapter 7 for linearquadratic\frac{\text{linear}}{\text{quadratic}}⁠: a log part and a tan⁡−1\tan^{-1} part.

Given, to find, and the plan
Given
(x−y)dydx=x+2y(x - y)\frac{dy}{dx} = x + 2y⁠.
To show and find
That the equation is homogeneous; then its general solution.
Plan
(1) Write it as dydx=F(x,y)\frac{dy}{dx} = F(x, y)⁠. (2) Show F(λx,λy)=F(x,y)F(\lambda x, \lambda y) = F(x, y)⁠. (3) Put y=vxy = vx⁠. (4) Simplify to xdvdx=…x\frac{dv}{dx} = \ldots⁠. (5) Separate. (6) Integrate: log part and tan⁡−1\tan^{-1} part. (7) Put v=yxv = \frac{y}{x} back and tidy. (8) Check by implicit differentiation.

Basics you need

1Homogeneous functions and equations

F(x,y)F(x, y) is homogeneous of degree nn if F(λx,λy)=λnF(x,y)F(\lambda x, \lambda y) = \lambda^nF(x, y) for every nonzero λ\lambda⁠. The equation dydx=F(x,y)\frac{dy}{dx} = F(x, y) is homogeneous when FF is homogeneous of degree zero (Section 9.4.2). Basics: scale x and y together

2The substitution y=vxy = vx

With y=vxy = vx⁠, the product rule gives dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠; the equation becomes separable in vv and xx (Section 9.4.2, equations (2) to (6)). Lesson: homogeneous equations, put y = vx

3Two integrals from Chapter 7

∫f′(v)f(v) dv=log⁡∣f(v)∣+C\int\frac{f'(v)}{f(v)}\,dv = \log|f(v)| + C (substitution t=f(v)t = f(v)⁠), and ∫dvv2+a2=1atan⁡−1va+C\int\frac{dv}{v^2 + a^2} = \frac1a\tan^{-1}\frac{v}{a} + C (Section 7.4, formula (3)). Basics: every method ends with an integral

4Completing the square

v2+v+1=(v+12)2+34v^2 + v + 1 = \left(v + \frac12\right)^2 + \frac34⁠, and 34=(32)2\frac34 = \left(\frac{\sqrt3}{2}\right)^2⁠.

5Log rules

log⁡∣x∣=12log⁡x2\log|x| = \frac12\log x^2 (since x2=∣x∣2x^2 = |x|^2⁠), log⁡a+log⁡b=log⁡ab\log a + \log b = \log ab for a,b>0a, b > 0⁠. Basics: e and log

Solution

  1. Write the equation as dydx=F(x,y)\frac{dy}{dx} = F(x, y)

    For x≠yx \ne y⁠, divide by x−yx - y⁠:

    dydx=x+2yx−y=F(x,y).…(1)\frac{dy}{dx} = \frac{x + 2y}{x - y} = F(x, y).\quad\ldots(1)
    The homogeneity test is stated for dydx=F(x,y)\frac{dy}{dx} = F(x, y)⁠. Dividing loses nothing: on the line y=xy = x (with x≠0x \ne 0⁠) the given equation would read 0=x+2x=3x≠00 = x + 2x = 3x \ne 0⁠, so no solution curve y(x)y(x) can pass through such a point anyway.
    Section 9.4.2: a homogeneous equation has the form dydx=F(x,y)\frac{dy}{dx} = F(x, y)⁠. Lesson: homogeneous equations
  2. Show that it is homogeneous: F(λx,λy)=F(x,y)F(\lambda x, \lambda y) = F(x, y)

    Replace xx by λx\lambda x and yy by λy\lambda y⁠, for any λ≠0\lambda \ne 0⁠:

    F(λx,λy)=λx+2λyλx−λy=λ(x+2y)λ(x−y)=λ0⋅F(x,y).\begin{aligned} F(\lambda x, \lambda y) &= \frac{\lambda x + 2\lambda y}{\lambda x - \lambda y} = \frac{\lambda(x + 2y)}{\lambda(x - y)} \\ &= \lambda^0\cdot F(x, y). \end{aligned}

    So FF is a homogeneous function of degree zero, and (1) is a homogeneous differential equation. Equivalently, dividing top and bottom by xx⁠, F(x,y)=1+2yx1−yxF(x, y) = \frac{1 + 2\frac{y}{x}}{1 - \frac{y}{x}}⁠, a function of yx\frac{y}{x} alone.

    The λ\lambda cancels because top and bottom both have degree 1. "Degree zero" is exactly the condition for the equation to be homogeneous. (The book writes the result as λ0⋅f(x,y)\lambda^0\cdot f(x, y) with a small ff⁠; it means the same function FF⁠.)
    Section 9.4.2: definition of a homogeneous function of degree nn⁠. Basics: scale x and y together
  3. Substitute y=vxy = vx

    Put y=vxy = vx⁠, where vv is a function of xx⁠. By the product rule,

    dydx=v+xdvdx.\frac{dy}{dx} = v + x\frac{dv}{dx}.

    Substituting in (1), and dividing top and bottom by xx⁠:

    v+xdvdx=x+2vxx−vx=1+2v1−v.v + x\frac{dv}{dx} = \frac{x + 2vx}{x - vx} = \frac{1 + 2v}{1 - v}.
    Because FF depends only on yx=v\frac{y}{x} = v⁠, the right side becomes a function of vv only. The left side has xdvdxx\frac{dv}{dx}⁠, which is what will let us separate vv from xx⁠. Here x≠0x \ne 0⁠, since v=yxv = \frac{y}{x}⁠.
    Section 9.4.2, equations (2) and (3). Lesson: put y = vx
  4. Simplify to xdvdx=…x\frac{dv}{dx} = \ldots

    xdvdx=1+2v1−v−v=1+2v−v(1−v)1−v=v2+v+11−v.\begin{aligned} x\frac{dv}{dx} &= \frac{1 + 2v}{1 - v} - v \\ &= \frac{1 + 2v - v(1 - v)}{1 - v} \\ &= \frac{v^2 + v + 1}{1 - v}. \end{aligned}
    Subtract vv by writing it over the common denominator 1−v1 - v⁠: 1+2v−v+v2=v2+v+11 + 2v - v + v^2 = v^2 + v + 1⁠. Now the right side is a function of vv only, and the left side is xdvdxx\frac{dv}{dx}⁠: the equation is separable.
    Section 9.4.2, equation (4): xdvdx=g(v)−vx\frac{dv}{dx} = g(v) - v⁠. Lesson: homogeneous equations
  5. Separate vv and xx

    1−vv2+v+1 dv=dxx,that isv−1v2+v+1 dv=−dxx.\begin{aligned} \frac{1 - v}{v^2 + v + 1}\,dv &= \frac{dx}{x}, \quad\text{that is} \\ \frac{v - 1}{v^2 + v + 1}\,dv &= -\frac{dx}{x}. \end{aligned}
    Multiply by 1−vv2+v+1\frac{1 - v}{v^2 + v + 1} and by dxx\frac{dx}{x}⁠. This is allowed: v2+v+1=(v+12)2+34>0v^2 + v + 1 = \left(v + \frac12\right)^2 + \frac34 > 0 for every vv⁠, and x≠0x \ne 0⁠. Writing v−1v - 1 on top (and a minus on the right) matches the book's form.
    Section 9.4.2, equation (5); separating as in Section 9.4.1. Basics: dy = y′ dx
  6. Integrate the vv side: a log part and a tan⁡−1\tan^{-1} part

    Split the numerator using the derivative of the denominator, ddv(v2+v+1)=2v+1\frac{d}{dv}(v^2 + v + 1) = 2v + 1⁠:

    v−1=12(2v+1)−32.v - 1 = \tfrac12(2v + 1) - \tfrac32.

    So

    ∫v−1v2+v+1 dv=12∫2v+1v2+v+1 dv−32∫dv(v+12)2+(32)2.\begin{aligned} &\int\frac{v - 1}{v^2 + v + 1}\,dv \\ &= \frac12\int\frac{2v + 1}{v^2 + v + 1}\,dv \\ &\quad - \frac32\int\frac{dv}{\left(v + \frac12\right)^2 + \left(\frac{\sqrt3}{2}\right)^2}. \end{aligned}

    First part: put t=v2+v+1t = v^2 + v + 1⁠, dt=(2v+1) dvdt = (2v + 1)\,dv⁠: it is 12log⁡∣t∣=12log⁡(v2+v+1)\frac12\log|t| = \frac12\log(v^2 + v + 1)⁠.

    Second part: with a=32a = \frac{\sqrt3}{2}⁠, Section 7.4 formula (3) gives

    ∫dv(v+12)2+a2=1atan⁡−1v+12a=23tan⁡−12v+13.\begin{aligned} \int\frac{dv}{\left(v + \frac12\right)^2 + a^2} &= \frac{1}{a}\tan^{-1}\frac{v + \frac12}{a} \\ &= \frac{2}{\sqrt3}\tan^{-1}\frac{2v + 1}{\sqrt3}. \end{aligned}

    The xx side is −∫dxx=−log⁡∣x∣-\int\frac{dx}{x} = -\log|x|⁠. Hence, with one constant C1C_1⁠,

    12log⁡(v2+v+1)−3tan⁡−12v+13=−log⁡∣x∣+C1.…(2)\begin{aligned} &\frac12\log(v^2 + v + 1) - \sqrt3\tan^{-1}\frac{2v + 1}{\sqrt3} \\ &= -\log|x| + C_1.\quad\ldots(2) \end{aligned}

    Check by differentiating the left side of (2) with respect to vv⁠:

    2v+12(v2+v+1)−3⋅231+(2v+1)23=2v+12(v2+v+1)−64(v2+v+1)=v−1v2+v+1.\begin{aligned} &\frac{2v + 1}{2(v^2 + v + 1)} - \sqrt3\cdot\frac{\frac{2}{\sqrt3}}{1 + \frac{(2v + 1)^2}{3}} \\ &= \frac{2v + 1}{2(v^2 + v + 1)} - \frac{6}{4(v^2 + v + 1)} \\ &= \frac{v - 1}{v^2 + v + 1}. \end{aligned}
    An integrand linearquadratic\frac{\text{linear}}{\text{quadratic}} is split into (a multiple of the derivative of the bottom) plus (a constant): the first piece gives a log, the second a tan⁡−1\tan^{-1} after completing the square. The coefficient is 32⋅23=3\frac32\cdot\frac{2}{\sqrt3} = \sqrt3⁠. In the check, 3+(2v+1)2=4(v2+v+1)3 + (2v + 1)^2 = 4(v^2 + v + 1)⁠.
    Section 7.4, formula (3), and ∫f′f=log⁡∣f∣\int\frac{f'}{f} = \log|f| by substitution. Basics: every method ends with an integral
  7. Put v=yxv = \frac{y}{x} back and tidy up

    Move −log⁡∣x∣-\log|x| to the left, using log⁡∣x∣=12log⁡x2\log|x| = \frac12\log x^2 (this answers the book's "(Why?)": x2=∣x∣2x^2 = |x|^2⁠):

    12log⁡(v2+v+1)+12log⁡x2=3tan⁡−12v+13+C1.\begin{aligned} &\frac12\log(v^2 + v + 1) + \frac12\log x^2 \\ &= \sqrt3\tan^{-1}\frac{2v + 1}{\sqrt3} + C_1. \end{aligned}

    Combine the logs, 12log⁡[(v2+v+1)x2]\frac12\log\big[(v^2 + v + 1)x^2\big]⁠, and put v=yxv = \frac{y}{x}⁠:

    (y2x2+yx+1)x2=y2+xy+x2,\left(\frac{y^2}{x^2} + \frac{y}{x} + 1\right)x^2 = y^2 + xy + x^2, 2v+13=2y+x3x.\frac{2v + 1}{\sqrt3} = \frac{2y + x}{\sqrt3x}.

    Multiply by 2 and write C=2C1C = 2C_1⁠:

    log⁡∣x2+xy+y2∣=23tan⁡−1x+2y3x+C.\begin{aligned} &\log|x^2 + xy + y^2| \\ &= 2\sqrt3\tan^{-1}\frac{x + 2y}{\sqrt3x} + C. \end{aligned}
    Both log arguments are positive (x2>0x^2 > 0 and v2+v+1>0v^2 + v + 1 > 0⁠), so they may be combined. Since x2+xy+y2>0x^2 + xy + y^2 > 0 away from the origin, the absolute value bars in the book's answer change nothing. C=2C1C = 2C_1 is again an arbitrary constant, the one constant of a first order equation.
    log⁡a+log⁡b=log⁡ab\log a + \log b = \log ab (a,b>0a, b > 0⁠). Basics: one constant for order 1
  8. Check: differentiate the answer back

    Write Q=x2+xy+y2Q = x^2 + xy + y^2 and u=x+2y3xu = \frac{x + 2y}{\sqrt3x}⁠. Then 1+u2=4Q3x21 + u^2 = \frac{4Q}{3x^2} and dudx=2(xy′−y)3x2\frac{du}{dx} = \frac{2(xy' - y)}{\sqrt3x^2}⁠. Differentiating the answer with respect to xx⁠:

    2x+y+(x+2y)y′Q=23⋅3x24Q⋅2(xy′−y)3x2=3(xy′−y)Q,\begin{aligned} &\frac{2x + y + (x + 2y)y'}{Q} \\ &= 2\sqrt3\cdot\frac{3x^2}{4Q}\cdot\frac{2(xy' - y)}{\sqrt3x^2} \\ &= \frac{3(xy' - y)}{Q}, \end{aligned}

    so, multiplying by QQ⁠,

    2x+y+(x+2y)y′=3xy′−3y(2y−2x) y′=−(2x+4y)y′=x+2yx−y.\begin{aligned} 2x + y + (x + 2y)y' &= 3xy' - 3y \\ (2y - 2x)\,y' &= -(2x + 4y) \\ y' &= \frac{x + 2y}{x - y}. \end{aligned}
    X Y X′ Y′ (1, 0) (−1, 0) y = x O
    Slope field of dydx=x+2yx−y\frac{dy}{dx} = \frac{x + 2y}{x - y} with equal scales: along each ray from the origin the marks are parallel, because the slope depends only on yx\frac{y}{x}⁠. The solution curve through (1,0)(1, 0) and its reflection in the origin through (−1,0)(-1, 0) are drawn; each turns vertical where it meets the dashed line y=xy = x⁠. Near the origin each curve meets the yy-axis at a distance e−2π/3≈0.027e^{-2\pi/\sqrt3} \approx 0.027 from OO⁠, too close to see, and continues on the other side; the origin itself is on no solution curve.
    We recover the given equation for every value of CC⁠, so the relation is the general solution. The picture shows homogeneity at work: F(λx,λy)=F(x,y)F(\lambda x, \lambda y) = F(x, y) means the slope is the same at all points of a ray through the origin, and a curve reflected in the origin is again a solution.
    Implicit differentiation, chain rule, ddutan⁡−1u=11+u2\frac{d}{du}\tan^{-1}u = \frac{1}{1 + u^2} (Chapter 5). Basics: a rule for slopes
Result

The equation is homogeneous, since F(λx,λy)=λ0F(x,y)F(\lambda x, \lambda y) = \lambda^0F(x, y)⁠. Its general solution is log⁡∣x2+xy+y2∣=23tan⁡−1x+2y3x+C\log|x^2 + xy + y^2| = 2\sqrt3\tan^{-1}\frac{x + 2y}{\sqrt3x} + C⁠, where C=2C1C = 2C_1 is an arbitrary constant (x≠0x \ne 0⁠, x≠yx \ne y⁠). (Textbook answer: log⁡∣x2+xy+y2∣=23tan⁡−1(x+2y3x)+C\log|x^2 + xy + y^2| = 2\sqrt3\tan^{-1}\left(\frac{x + 2y}{\sqrt3x}\right) + C⁠.)

Check it with numbers

Take the curve through (1,0)(1, 0)⁠: there C=log⁡1−23tan⁡−113=−π3≈−1.813799C = \log 1 - 2\sqrt3\tan^{-1}\frac{1}{\sqrt3} = -\frac{\pi}{\sqrt3} \approx -1.813799⁠. Solving numerically, this curve passes through (1.2, 0.2773934)(1.2,\ 0.2773934)⁠. At that point log⁡(x2+xy+y2)≈0.615088\log(x^2 + xy + y^2) \approx 0.615088⁠. On the other side, 23tan⁡−1x+2y3x≈2.4288872\sqrt3\tan^{-1}\frac{x + 2y}{\sqrt3x} \approx 2.428887⁠, and adding CC gives 2.428887−1.813799=0.6150882.428887 - 1.813799 = 0.615088⁠. The two sides agree.

The equation gives the slope x+2yx−y≈1.9020\frac{x + 2y}{x - y} \approx 1.9020 there. The curve itself: y(1.201)≈0.2792989008y(1.201) \approx 0.2792989008 and y(1.199)≈0.2754949102y(1.199) \approx 0.2754949102⁠, so

0.2792989008−0.27549491020.002≈1.9020.\begin{aligned} &\frac{0.2792989008 - 0.2754949102}{0.002} \\ &\approx 1.9020. \end{aligned}
Common mistakes
  1. Writing dydx=xdvdx\frac{dy}{dx} = x\frac{dv}{dx} after putting y=vxy = vx⁠. The product rule gives v+xdvdxv + x\frac{dv}{dx}⁠.
  2. Forgetting to subtract vv when moving it across: xdvdx=1+2v1−v−vx\frac{dv}{dx} = \frac{1 + 2v}{1 - v} - v⁠, not 1+2v1−v\frac{1 + 2v}{1 - v}⁠.
  3. Integrating v−1v2+v+1\frac{v - 1}{v^2 + v + 1} as log⁡(v2+v+1)\log(v^2 + v + 1)⁠. The top is not the derivative of the bottom; split it first.
  4. Leaving vv in the answer. Put v=yxv = \frac{y}{x} back.
What to take away
  1. Homogeneous test: F(λx,λy)=λ0F(x,y)F(\lambda x, \lambda y) = \lambda^0F(x, y)⁠, or FF is a function of yx\frac{y}{x} alone.
  2. Then y=vxy = vx⁠, dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠, and the equation separates in vv and xx⁠.
  3. For ∫linearquadratic\int\frac{\text{linear}}{\text{quadratic}}⁠: split off the derivative of the bottom (log), complete the square for the rest (tan⁡−1\tan^{-1}⁠).

Every fact used, and where it comes from

FactUsed inSource
Homogeneous function of degree nn⁠; homogeneous equation when FF has degree zeroSteps 1, 2Section 9.4.2 (Basics)
y=vxy = vx⁠, dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠; xdvdx=g(v)−vx\frac{dv}{dx} = g(v) - v⁠; separate and integrateSteps 3, 4, 5Section 9.4.2, equations (1) to (6) (Lesson)
∫f′(v)f(v) dv=log⁡∣f(v)∣+C\int\frac{f'(v)}{f(v)}\,dv = \log|f(v)| + CStep 6Chapter 7, integration by substitution (Basics)
∫dxx2+a2=1atan⁡−1xa+C\int\frac{dx}{x^2 + a^2} = \frac1a\tan^{-1}\frac{x}{a} + CStep 6Section 7.4, formula (3)
∫dxx=log⁡∣x∣+C\int\frac{dx}{x} = \log|x| + CStep 6Section 7.2, formula (xii)
log⁡∣x∣=12log⁡x2\log|x| = \frac12\log x^2⁠; log⁡a+log⁡b=log⁡ab\log a + \log b = \log abStep 7Chapter 5, Section 5.4 (Basics)
Implicit differentiation; ddutan⁡−1u=11+u2\frac{d}{du}\tan^{-1}u = \frac{1}{1 + u^2}Steps 6, 8Chapter 5, Sections 5.3.2 and 5.3.3 (Basics)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →