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

Example 21: (x dy−y dx) ysin⁡yx=(y dx+x dy) xcos⁡yx(x\,dy - y\,dx)\,y\sin\frac{y}{x} = (y\,dx + x\,dy)\,x\cos\frac{y}{x}

ExamplesMiscellaneous Examples: a homogeneous equation · Section 9.4.2
The question

Solve the differential equation

(x dy−y dx) ysin⁡(yx)=(y dx+x dy) xcos⁡(yx).\begin{aligned} &(x\,dy - y\,dx)\,y\sin\left(\frac{y}{x}\right) \\ &= (y\,dx + x\,dy)\,x\cos\left(\frac{y}{x}\right). \end{aligned}
Exam answer

The equation can be written as

[xysin⁡yx−x2cos⁡yx]dy=[xycos⁡yx+y2sin⁡yx]dx\begin{aligned} &\left[xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}\right]dy \\ &= \left[xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}\right]dx \end{aligned} dydx=xycos⁡yx+y2sin⁡yxxysin⁡yx−x2cos⁡yx=F(x,y)\begin{aligned} \frac{dy}{dx} &= \frac{xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}}{xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}} \\ &= F(x, y) \end{aligned}

Replacing xx by λx\lambda x and yy by λy\lambda y (so that yx\frac{y}{x} is unchanged),

F(λx,λy)=λ2(xycos⁡yx+y2sin⁡yx)λ2(xysin⁡yx−x2cos⁡yx)=λ0⋅F(x,y)\begin{aligned} &F(\lambda x, \lambda y) \\ &= \frac{\lambda^2\left(xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}\right)}{\lambda^2\left(xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}\right)} \\ &= \lambda^0\cdot F(x, y) \end{aligned}

So the equation is homogeneous. Dividing the numerator and the denominator by x2x^2⁠,

dydx=yxcos⁡yx+y2x2sin⁡yxyxsin⁡yx−cos⁡yx\frac{dy}{dx} = \frac{\frac{y}{x}\cos\frac{y}{x} + \frac{y^2}{x^2}\sin\frac{y}{x}}{\frac{y}{x}\sin\frac{y}{x} - \cos\frac{y}{x}}

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

v+xdvdx=vcos⁡v+v2sin⁡vvsin⁡v−cos⁡vxdvdx=vcos⁡v+v2sin⁡vvsin⁡v−cos⁡v−v=2vcos⁡vvsin⁡v−cos⁡v\begin{aligned} v + x\frac{dv}{dx} &= \frac{v\cos v + v^2\sin v}{v\sin v - \cos v} \\ x\frac{dv}{dx} &= \frac{v\cos v + v^2\sin v}{v\sin v - \cos v} - v \\ &= \frac{2v\cos v}{v\sin v - \cos v} \end{aligned}

Separating the variables,

(vsin⁡v−cos⁡vvcos⁡v)dv=2 dxx\left(\frac{v\sin v - \cos v}{v\cos v}\right)dv = \frac{2\,dx}{x}

Integrating both sides,

∫(tan⁡v−1v)dv=2∫dxxlog⁡∣sec⁡v∣−log⁡∣v∣=2log⁡∣x∣+log⁡∣C1∣log⁡∣sec⁡vvx2∣=log⁡∣C1∣sec⁡vvx2=±C1\begin{aligned} &\int\left(\tan v - \frac{1}{v}\right)dv = 2\int\frac{dx}{x} \\ &\log|\sec v| - \log|v| \\ &\quad = 2\log|x| + \log|C_1| \\ &\log\left|\frac{\sec v}{vx^2}\right| = \log|C_1| \\ &\frac{\sec v}{vx^2} = \pm C_1 \end{aligned}

Putting v=yxv = \frac{y}{x} and writing C=±C1C = \pm C_1⁠,

sec⁡yxyx⋅x2=C\frac{\sec\frac{y}{x}}{\frac{y}{x}\cdot x^2} = C

∴\therefore sec⁡(yx)=Cxy\sec\left(\dfrac{y}{x}\right) = Cxy is the general solution.

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

The one idea this problem is built on

Once the dydy terms and the dxdx terms are collected, every term outside the trigonometric functions has degree 2 (xyxy⁠, x2x^2⁠, y2y^2⁠), and inside them xx and yy appear only as yx\frac{y}{x}⁠. So dydx\frac{dy}{dx} is a function of yx\frac{y}{x} alone: the equation is homogeneous, and y=vxy = vx separates it. The vv-integral splits into tan⁡v−1v\tan v - \frac{1}{v}⁠, and writing the constant as log⁡∣C1∣\log|C_1| lets all the logs combine.

Given, to find, and the plan
Given
(x dy−y dx) ysin⁡yx=(y dx+x dy) xcos⁡yx(x\,dy - y\,dx)\,y\sin\frac{y}{x} = (y\,dx + x\,dy)\,x\cos\frac{y}{x}⁠, with x≠0x \ne 0⁠.
To find
The general solution.
Plan
(1) Collect the dydy and dxdx terms. (2) Write dydx=F(x,y)\frac{dy}{dx} = F(x, y)⁠. (3) Show F(λx,λy)=F(x,y)F(\lambda x, \lambda y) = F(x, y)⁠. (4) Write FF as a function of yx\frac{y}{x}⁠. (5) Put y=vxy = vx and simplify. (6) Separate. (7) Integrate. (8) Remove the logs. (9) Put v=yxv = \frac{y}{x} back. (10) Look at the cases set aside. (11) Check.

Basics you need

1Homogeneous equations

dydx=F(x,y)\frac{dy}{dx} = F(x, y) with F(λx,λy)=λ0F(x,y)F(\lambda x, \lambda y) = \lambda^0F(x, y)⁠; equivalently F=g(yx)F = g\left(\frac{y}{x}\right)⁠. Put y=vxy = vx⁠, dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx} (Section 9.4.2). Lesson: homogeneous equations, put y = vx

2Scaling

λyλx=yx\frac{\lambda y}{\lambda x} = \frac{y}{x}⁠, so sin⁡yx\sin\frac{y}{x} and cos⁡yx\cos\frac{y}{x} do not change when xx⁠, yy are scaled together. Basics: scale x and y together

3Two integrals

∫tan⁡v dv=log⁡∣sec⁡v∣\int\tan v\,dv = \log|\sec v| and ∫dvv=log⁡∣v∣\int\frac{dv}{v} = \log|v| (Section 7.3.1; Section 7.2, formula (xii)). Basics: every method ends with an integral

4Logs and the constant

log⁡a−log⁡b=log⁡ab\log a - \log b = \log\frac{a}{b}⁠, 2log⁡∣x∣=log⁡x22\log|x| = \log x^2⁠; a constant written log⁡∣C1∣\log|C_1| is still one arbitrary constant. Basics: one constant for order 1

Solution

  1. Collect the dydy terms and the dxdx terms

    Expand both sides:

    xysin⁡yx dy−y2sin⁡yx dx=xycos⁡yx dx+x2cos⁡yx dy,\begin{aligned} &xy\sin\frac{y}{x}\,dy - y^2\sin\frac{y}{x}\,dx \\ &= xy\cos\frac{y}{x}\,dx + x^2\cos\frac{y}{x}\,dy, \end{aligned}

    so

    [xysin⁡yx−x2cos⁡yx]dy=[xycos⁡yx+y2sin⁡yx]dx.\begin{aligned} &\left[xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}\right]dy \\ &= \left[xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}\right]dx. \end{aligned}
    Multiply out, then move every dydy term to the left and every dxdx term to the right. This is the step that makes the structure visible.
    Rearranging a differential form. Basics: dy = y′ dx
  2. Write dydx=F(x,y)\frac{dy}{dx} = F(x, y)

    dydx=xycos⁡yx+y2sin⁡yxxysin⁡yx−x2cos⁡yx=F(x,y).\frac{dy}{dx} = \frac{xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}}{xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}} = F(x, y).
    Divide by dxdx and by the bracket on the left, where it is not 0. (At points where xysin⁡yx=x2cos⁡yxxy\sin\frac{y}{x} = x^2\cos\frac{y}{x} a solution curve has a vertical tangent; the formula is used away from them.)
    Section 9.4.2: the form dydx=F(x,y)\frac{dy}{dx} = F(x, y)⁠. Lesson: homogeneous equations
  3. Show that it is homogeneous: F(λx,λy)=F(x,y)F(\lambda x, \lambda y) = F(x, y)

    For λ≠0\lambda \ne 0⁠, λyλx=yx\frac{\lambda y}{\lambda x} = \frac{y}{x}⁠, and each of xyxy⁠, y2y^2⁠, x2x^2 picks up λ2\lambda^2⁠:

    F(λx,λy)=λ2(xycos⁡yx+y2sin⁡yx)λ2(xysin⁡yx−x2cos⁡yx)=λ0⋅F(x,y).\begin{aligned} F(\lambda x, \lambda y) &= \frac{\lambda^2\left(xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}\right)}{\lambda^2\left(xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}\right)} \\ &= \lambda^0\cdot F(x, y). \end{aligned}

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

    The book divides by x2x^2 and says this is "clear"; the line above is the definition checked directly. Both show the same thing.
    Section 9.4.2: homogeneous function of degree nn⁠. Basics: scale x and y together
  4. Write FF as a function of yx\frac{y}{x}

    Divide the numerator and the denominator by x2x^2⁠:

    dydx=yxcos⁡yx+y2x2sin⁡yxyxsin⁡yx−cos⁡yx.…(1)\frac{dy}{dx} = \frac{\frac{y}{x}\cos\frac{y}{x} + \frac{y^2}{x^2}\sin\frac{y}{x}}{\frac{y}{x}\sin\frac{y}{x} - \cos\frac{y}{x}}.\quad\ldots(1)
    xyx2=yx\frac{xy}{x^2} = \frac{y}{x}⁠, y2x2=(yx)2\frac{y^2}{x^2} = \left(\frac{y}{x}\right)^2⁠, x2x2=1\frac{x^2}{x^2} = 1⁠. Now every piece is a function of yx\frac{y}{x}⁠, the form dydx=g(yx)\frac{dy}{dx} = g\left(\frac{y}{x}\right)⁠.
    Section 9.4.2, equation (1): dydx=g(yx)\frac{dy}{dx} = g\left(\frac{y}{x}\right)⁠. Lesson: homogeneous equations
  5. Substitute y=vxy = vx and simplify

    With y=vxy = vx⁠, dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠, and (1) becomes

    v+xdvdx=vcos⁡v+v2sin⁡vvsin⁡v−cos⁡vxdvdx=vcos⁡v+v2sin⁡vvsin⁡v−cos⁡v−v=2vcos⁡vvsin⁡v−cos⁡v.\begin{aligned} v + x\frac{dv}{dx} &= \frac{v\cos v + v^2\sin v}{v\sin v - \cos v} \\ x\frac{dv}{dx} &= \frac{v\cos v + v^2\sin v}{v\sin v - \cos v} - v \\ &= \frac{2v\cos v}{v\sin v - \cos v}. \end{aligned}
    Subtract v=v(vsin⁡v−cos⁡v)vsin⁡v−cos⁡vv = \frac{v(v\sin v - \cos v)}{v\sin v - \cos v}⁠: the v2sin⁡vv^2\sin v terms cancel and the vcos⁡vv\cos v terms add.
    Section 9.4.2, equations (2) to (4). Lesson: put y = vx
  6. Separate vv and xx

    vsin⁡v−cos⁡vvcos⁡v dv=2 dxx(tan⁡v−1v)dv=2 dxx.\begin{aligned} \frac{v\sin v - \cos v}{v\cos v}\,dv &= \frac{2\,dx}{x} \\ \left(\tan v - \frac{1}{v}\right)dv &= \frac{2\,dx}{x}. \end{aligned}
    Dividing by 2vcos⁡v2v\cos v needs v≠0v \ne 0 and cos⁡v≠0\cos v \ne 0 (Step 10 looks at these cases). Then split the fraction: vsin⁡vvcos⁡v=tan⁡v\frac{v\sin v}{v\cos v} = \tan v and cos⁡vvcos⁡v=1v\frac{\cos v}{v\cos v} = \frac{1}{v}⁠.
    Separating, Section 9.4.1. Basics: dy = y′ dx
  7. Integrate, writing the constant as log⁡∣C1∣\log|C_1|

    ∫tan⁡v dv−∫1v dv=2∫1x dxlog⁡∣sec⁡v∣−log⁡∣v∣=2log⁡∣x∣+log⁡∣C1∣,\begin{aligned} &\int\tan v\,dv - \int\frac{1}{v}\,dv = 2\int\frac{1}{x}\,dx \\ &\log|\sec v| - \log|v| \\ &\quad = 2\log|x| + \log|C_1|, \end{aligned}

    where C1≠0C_1 \ne 0 is an arbitrary constant.

    ∫tan⁡v dv=log⁡∣sec⁡v∣\int\tan v\,dv = \log|\sec v|⁠. Every real constant is log⁡∣C1∣\log|C_1| for some C1≠0C_1 \ne 0⁠; this form lets the logs combine. One constant, as order 1 requires.
    Section 7.3.1 (∫tan⁡x dx=log⁡∣sec⁡x∣\int\tan x\,dx = \log|\sec x|⁠); Section 7.2, formula (xii). Basics: every method ends with an integral
  8. Remove the logs

    log⁡∣sec⁡v∣−log⁡∣v∣−log⁡x2=log⁡∣C1∣log⁡∣sec⁡vvx2∣=log⁡∣C1∣sec⁡vvx2=±C1.…(2)\begin{aligned} &\log|\sec v| - \log|v| - \log x^2 \\ &\quad = \log|C_1| \\ &\log\left|\frac{\sec v}{vx^2}\right| = \log|C_1| \\ &\frac{\sec v}{vx^2} = \pm C_1.\quad\ldots(2) \end{aligned}
    2log⁡∣x∣=log⁡x22\log|x| = \log x^2⁠, and log⁡a−log⁡b=log⁡ab\log a - \log b = \log\frac{a}{b}⁠. Equal logs mean equal absolute values, so the two sides are equal or opposite: hence ±C1\pm C_1⁠.
    Laws of logarithms (Chapter 5, Section 5.4). Basics: one constant for order 1
  9. Put v=yxv = \frac{y}{x} back

    sec⁡yxyx⋅x2=C,where C=±C1sec⁡(yx)=Cxy.\begin{aligned} \frac{\sec\frac{y}{x}}{\frac{y}{x}\cdot x^2} &= C, \quad\text{where } C = \pm C_1 \\ \sec\left(\frac{y}{x}\right) &= Cxy. \end{aligned}
    yx⋅x2=xy\frac{y}{x}\cdot x^2 = xy⁠; multiply both sides by xyxy⁠. C=±C1C = \pm C_1 is one arbitrary nonzero constant.
    Section 9.4.2: replace vv to get the general solution. Lesson: Examples 19 to 22
  10. The cases set aside in Step 6

    If v=0v = 0⁠, the curve is y=0y = 0⁠; if cos⁡v=0\cos v = 0⁠, it is a line y=kxy = kx with cos⁡k=0\cos k = 0⁠. In both cases x dy−y dx=0x\,dy - y\,dx = 0 along the line (since dy=k dxdy = k\,dx⁠), so the left side of the given equation is 0; and the right side is 0 too (y=0y = 0 and dy=0dy = 0 in the first case, cos⁡yx=cos⁡k=0\cos\frac{y}{x} = \cos k = 0 in the second). So these lines also satisfy the given equation.

    They are not members of the family sec⁡yx=Cxy\sec\frac{y}{x} = Cxy (on y=0y = 0 it would read 1=01 = 0⁠; on y=kxy = kx the secant is undefined). The general solution with its one constant is the family found in Step 9, as the book gives it; these lines are extra solutions that the division in Step 6 set aside. The book does not discuss them.
    Check the zeros of anything you divide by. Lesson: general and particular solutions
  11. Check by differentiating back

    From sec⁡yx=Cxy\sec\frac{y}{x} = Cxy⁠, differentiate with respect to xx⁠:

    sec⁡yxtan⁡yx⋅xy′−yx2=C(y+xy′).\sec\frac{y}{x}\tan\frac{y}{x}\cdot\frac{xy' - y}{x^2} = C(y + xy').

    Put C=sec⁡(y/x)xyC = \frac{\sec(y/x)}{xy} (from the curve), cancel sec⁡yx\sec\frac{y}{x}⁠, and multiply by x2ycos⁡yxx^2y\cos\frac{y}{x}⁠:

    ysin⁡yx (xy′−y)=xcos⁡yx (y+xy′),\begin{aligned} &y\sin\frac{y}{x}\,(xy' - y) \\ &= x\cos\frac{y}{x}\,(y + xy'), \end{aligned}

    that is,

    [xysin⁡yx−x2cos⁡yx]y′=xycos⁡yx+y2sin⁡yx,\begin{aligned} &\left[xy\sin\frac{y}{x} - x^2\cos\frac{y}{x}\right]y' \\ &= xy\cos\frac{y}{x} + y^2\sin\frac{y}{x}, \end{aligned}

    which is the equation of Step 1.

    Eliminating CC between the curve and its derivative brings back the differential equation, so every curve of the family is a solution. The first line is also the given equation itself divided by dxdx⁠: (xy′−y) ysin⁡yx=(y+xy′) xcos⁡yx(xy' - y)\,y\sin\frac{y}{x} = (y + xy')\,x\cos\frac{y}{x}⁠.
    Implicit differentiation, chain and quotient rules (Chapter 5, Sections 5.3.1 and 5.3.2). Basics: a rule for slopes
Result

The equation is homogeneous, and its general solution is sec⁡(yx)=Cxy\sec\left(\frac{y}{x}\right) = Cxy⁠, where C≠0C \ne 0 is an arbitrary constant (x≠0x \ne 0⁠, y≠0y \ne 0⁠, cos⁡yx≠0\cos\frac{y}{x} \ne 0⁠). The lines y=0y = 0 and y=kxy = kx with cos⁡k=0\cos k = 0 also satisfy the equation. (Textbook answer: sec⁡(yx)=Cxy\sec\left(\frac{y}{x}\right) = Cxy⁠.)

Check it with numbers

Take the curve through (2,1)(2, 1)⁠: yx=0.5\frac{y}{x} = 0.5⁠, sec⁡0.5≈1.1394939\sec 0.5 \approx 1.1394939⁠, so C=sec⁡0.52⋅1≈0.5697470C = \frac{\sec 0.5}{2\cdot1} \approx 0.5697470⁠. With sin⁡0.5≈0.4794255\sin 0.5 \approx 0.4794255 and cos⁡0.5≈0.8775826\cos 0.5 \approx 0.8775826⁠, equation (1) gives the slope 0.5cos⁡0.5+0.25sin⁡0.50.5sin⁡0.5−cos⁡0.5≈−0.8758020\frac{0.5\cos 0.5 + 0.25\sin 0.5}{0.5\sin 0.5 - \cos 0.5} \approx -0.8758020⁠.

The curve itself (solving sec⁡yx=Cxy\sec\frac{y}{x} = Cxy near y=1y = 1⁠): y(2.001)≈0.9991255756y(2.001) \approx 0.9991255756 and y(1.999)≈1.0008771860y(1.999) \approx 1.0008771860⁠, so

0.9991255756−1.00087718600.002≈−0.8758.\begin{aligned} &\frac{0.9991255756 - 1.0008771860}{0.002} \\ &\approx -0.8758. \end{aligned}
Common mistakes
  1. Collecting the terms wrongly: the dydy bracket is xysin⁡yx−x2cos⁡yxxy\sin\frac{y}{x} - x^2\cos\frac{y}{x}⁠, the dxdx bracket xycos⁡yx+y2sin⁡yxxy\cos\frac{y}{x} + y^2\sin\frac{y}{x}⁠. Expand slowly.
  2. Subtracting vv wrongly in xdvdxx\frac{dv}{dx}⁠: the v2sin⁡vv^2\sin v terms cancel, and the result is 2vcos⁡vvsin⁡v−cos⁡v\frac{2v\cos v}{v\sin v - \cos v}⁠.
  3. ∫tan⁡v dv=sec⁡2v\int\tan v\,dv = \sec^2v or log⁡∣cos⁡v∣\log|\cos v|⁠; it is log⁡∣sec⁡v∣=−log⁡∣cos⁡v∣\log|\sec v| = -\log|\cos v|⁠.
  4. Losing the ±\pm when removing the logs, or not explaining the new constant C=±C1C = \pm C_1⁠.
What to take away
  1. With dxdx and dydy mixed on both sides, first collect the dydy and dxdx terms.
  2. yx\frac{y}{x} inside the functions and the same degree outside: homogeneous, put y=vxy = vx⁠.
  3. Split vsin⁡v−cos⁡vvcos⁡v\frac{v\sin v - \cos v}{v\cos v} into tan⁡v−1v\tan v - \frac{1}{v} before integrating.
  4. Dividing by an expression can set aside some solutions; look at its zeros.

Every fact used, and where it comes from

FactUsed inSource
Homogeneous function of degree zero; dydx=g(yx)\frac{dy}{dx} = g\left(\frac{y}{x}\right)Steps 3, 4Section 9.4.2 (Basics)
y=vxy = vx⁠, dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}Step 5Section 9.4.2, equations (2) to (4) (Lesson)
Separating the variablesStep 6Section 9.4.1 (Basics)
∫tan⁡v dv=log⁡∣sec⁡v∣+C\int\tan v\,dv = \log|\sec v| + C⁠; ∫dvv=log⁡∣v∣+C\int\frac{dv}{v} = \log|v| + CStep 7Section 7.3.1; Section 7.2, formula (xii) (Basics)
Laws of logarithms; the constant as log⁡∣C1∣\log|C_1|Steps 7, 8Chapter 5, Section 5.4 (Basics)
Zeros of a divisor checked separatelyStep 10Section 9.4.1 (separating needs h(y)≠0h(y) \ne 0⁠); Section 9.3, what a solution is (Lesson)
Implicit differentiation; chain and quotient rulesStep 11Chapter 5, Sections 5.3.1 and 5.3.2 (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 →