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

Example 11: Homogeneous: xcos⁡yx dydx=ycos⁡yx+xx\cos\frac{y}{x}\,\frac{dy}{dx} = y\cos\frac{y}{x} + x

ExamplesHomogeneous differential equations · Section 9.4.2
The question

Show that the differential equation xcos⁡(yx)dydx=ycos⁡(yx)+xx\cos\left(\dfrac{y}{x}\right)\dfrac{dy}{dx} = y\cos\left(\dfrac{y}{x}\right) + x is homogeneous and solve it.

Exam answer

The equation can be written as

dydx=ycos⁡yx+xxcos⁡yx=F(x,y)\frac{dy}{dx} = \frac{y\cos\frac{y}{x} + x}{x\cos\frac{y}{x}} = F(x, y)

Replacing xx by λx\lambda x and yy by λy\lambda y⁠,

F(λx,λy)=λ[ycos⁡yx+x]λ(xcos⁡yx)=λ0⋅F(x,y)\begin{aligned} F(\lambda x, \lambda y) &= \frac{\lambda\left[y\cos\frac{y}{x} + x\right]}{\lambda\left(x\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.

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

v+xdvdx=vcos⁡v+1cos⁡vxdvdx=vcos⁡v+1cos⁡v−v=1cos⁡v\begin{aligned} v + x\frac{dv}{dx} &= \frac{v\cos v + 1}{\cos v} \\ x\frac{dv}{dx} &= \frac{v\cos v + 1}{\cos v} - v \\ &= \frac{1}{\cos v} \end{aligned}

Separating the variables,

cos⁡v dv=dxx\cos v\,dv = \frac{dx}{x}

Integrating both sides,

∫cos⁡v dv=∫1x dxsin⁡v=log⁡∣x∣+log⁡∣C∣sin⁡v=log⁡∣Cx∣\begin{aligned} \int\cos v\,dv &= \int\frac{1}{x}\,dx \\ \sin v &= \log|x| + \log|C| \\ \sin v &= \log|Cx| \end{aligned}

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

∴\therefore sin⁡(yx)=log⁡∣Cx∣\sin\left(\dfrac{y}{x}\right) = \log|Cx| (C≠0C \ne 0⁠) is the general solution.

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

The one idea this problem is built on

Here yy and xx appear inside the cosine only as the ratio yx\frac{y}{x}⁠, and the other terms yy and xx have the same degree. So scaling xx and yy together leaves the slope unchanged: the equation is homogeneous, and y=vxy = vx turns it into the very simple separable equation cos⁡v dv=dxx\cos v\,dv = \frac{dx}{x}⁠. Writing the constant as log⁡∣C∣\log|C| lets the two logs combine into one.

Given, to find, and the plan
Given
xcos⁡yx dydx=ycos⁡yx+xx\cos\frac{y}{x}\,\frac{dy}{dx} = y\cos\frac{y}{x} + x⁠, with x≠0x \ne 0 (so that yx\frac{y}{x} is defined).
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=1cos⁡vx\frac{dv}{dx} = \frac{1}{\cos v}⁠. (5) Separate. (6) Integrate, with the constant as log⁡∣C∣\log|C|⁠. (7) Put v=yxv = \frac{y}{x} back and check.

Basics you need

1Homogeneous functions and equations

dydx=F(x,y)\frac{dy}{dx} = F(x, y) is homogeneous when F(λx,λy)=λ0F(x,y)F(\lambda x, \lambda y) = \lambda^0F(x, y) for every nonzero λ\lambda (Section 9.4.2). Any function of yx\frac{y}{x} alone passes this test, since λyλx=yx\frac{\lambda y}{\lambda x} = \frac{y}{x}⁠. Basics: scale x and y together

2The substitution y=vxy = vx

dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx} by the product rule; the equation becomes xdvdx=g(v)−vx\frac{dv}{dx} = g(v) - v⁠, which separates (Section 9.4.2). Lesson: homogeneous equations, put y = vx

3Two standard integrals

∫cos⁡v dv=sin⁡v+C\int\cos v\,dv = \sin v + C and ∫dxx=log⁡∣x∣+C\int\frac{dx}{x} = \log|x| + C (Section 7.2, formulas (ii) and (xii)). Basics: every method ends with an integral

4The constant written as log⁡∣C∣\log|C|

Every real number kk equals log⁡∣C∣\log|C| for a suitable C≠0C \ne 0 (take C=ekC = e^k⁠). So "+log⁡∣C∣+\log|C|" is just another way to write one arbitrary constant, and log⁡∣x∣+log⁡∣C∣=log⁡∣Cx∣\log|x| + \log|C| = \log|Cx|⁠. Basics: one constant for order 1

Solution

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

    Divide by xcos⁡yxx\cos\frac{y}{x} (where it is not 0):

    dydx=ycos⁡yx+xxcos⁡yx=F(x,y).…(1)\frac{dy}{dx} = \frac{y\cos\frac{y}{x} + x}{x\cos\frac{y}{x}} = F(x, y).\quad\ldots(1)
    The homogeneity test needs this form. Dividing loses nothing: at a point where cos⁡yx=0\cos\frac{y}{x} = 0⁠, the given equation would read 0=0+x0 = 0 + x⁠, impossible for x≠0x \ne 0⁠. So no solution curve y(x)y(x) passes through such points, and we may assume cos⁡yx≠0\cos\frac{y}{x} \ne 0⁠.
    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)

    For any λ≠0\lambda \ne 0⁠, λyλx=yx\frac{\lambda y}{\lambda x} = \frac{y}{x}⁠, so the cosines do not change:

    F(λx,λy)=λycos⁡yx+λxλxcos⁡yx=λ[ycos⁡yx+x]λ(xcos⁡yx)=λ0⋅F(x,y).\begin{aligned} F(\lambda x, \lambda y) &= \frac{\lambda y\cos\frac{y}{x} + \lambda x}{\lambda x\cos\frac{y}{x}} \\ &= \frac{\lambda\left[y\cos\frac{y}{x} + x\right]}{\lambda\left(x\cos\frac{y}{x}\right)} \\ &= \lambda^0\cdot F(x, y). \end{aligned}

    So FF is a homogeneous function of degree zero, and (1) is a homogeneous differential equation.

    Outside the cosines, the top ycos⁡yx+xy\cos\frac{y}{x} + x and the bottom xcos⁡yxx\cos\frac{y}{x} both have degree 1, so one factor λ\lambda comes out of each and cancels. Degree zero is the condition for a homogeneous equation.
    Section 9.4.2: homogeneous function of degree nn⁠. Basics: scale x and y together
  3. Substitute y=vxy = vx

    Put y=vxy = vx⁠; then yx=v\frac{y}{x} = v and dydx=v+xdvdx\frac{dy}{dx} = v + x\frac{dv}{dx}⁠. In (1), cancelling xx from top and bottom:

    v+xdvdx=vxcos⁡v+xxcos⁡v=vcos⁡v+1cos⁡v.v + x\frac{dv}{dx} = \frac{vx\cos v + x}{x\cos v} = \frac{v\cos v + 1}{\cos v}.
    Since FF depends only on yx\frac{y}{x}⁠, everything on the right becomes a function of vv⁠. The product rule on y=vxy = vx gives the left side.
    Section 9.4.2, equations (2) and (3). Lesson: put y = vx
  4. Simplify to xdvdx=…x\frac{dv}{dx} = \ldots

    xdvdx=vcos⁡v+1cos⁡v−v=vcos⁡v+1−vcos⁡vcos⁡v=1cos⁡v.\begin{aligned} x\frac{dv}{dx} &= \frac{v\cos v + 1}{\cos v} - v \\ &= \frac{v\cos v + 1 - v\cos v}{\cos v} = \frac{1}{\cos v}. \end{aligned}
    Writing vv over the common denominator cos⁡v\cos v⁠, the vcos⁡vv\cos v terms cancel, leaving a very simple separable equation.
    Section 9.4.2, equation (4): xdvdx=g(v)−vx\frac{dv}{dx} = g(v) - v⁠. Lesson: homogeneous equations
  5. Separate vv and xx

    cos⁡v dv=dxx.\cos v\,dv = \frac{dx}{x}.
    Multiply both sides by cos⁡v\cos v and by dxx\frac{dx}{x} (x≠0x \ne 0⁠). The left side has only vv⁠, the right side only xx⁠.
    Separating, as in Section 9.4.1. Basics: dy = y′ dx
  6. Integrate, writing the constant as log⁡∣C∣\log|C|

    ∫cos⁡v dv=∫1x dxsin⁡v=log⁡∣x∣+log⁡∣C∣=log⁡∣Cx∣,\begin{aligned} \int\cos v\,dv &= \int\frac{1}{x}\,dx \\ \sin v &= \log|x| + \log|C| \\ &= \log|Cx|, \end{aligned}

    where C≠0C \ne 0 is an arbitrary constant.

    The constant of integration can be any real number, and every real number is log⁡∣C∣\log|C| for some C≠0C \ne 0⁠. Choosing this form makes the right side a single log: log⁡∣x∣+log⁡∣C∣=log⁡∣x∣ ∣C∣=log⁡∣Cx∣\log|x| + \log|C| = \log|x|\,|C| = \log|Cx|⁠. There is still exactly one arbitrary constant, as order 1 requires.
    Section 7.2, formulas (ii) and (xii); the constant as log⁡∣C∣\log|C|⁠. Basics: one constant for order 1
  7. Put v=yxv = \frac{y}{x} back, and check

    Replacing vv by yx\frac{y}{x}⁠:

    sin⁡(yx)=log⁡∣Cx∣.\sin\left(\frac{y}{x}\right) = \log|Cx|.

    Check: differentiate with respect to xx⁠, with yy a function of xx (and ddxlog⁡∣Cx∣=1x\frac{d}{dx}\log|Cx| = \frac{1}{x}⁠):

    cos⁡yx⋅xy′−yx2=1xcos⁡yx (xy′−y)=xxcos⁡yx y′=ycos⁡yx+x,\begin{aligned} \cos\frac{y}{x}\cdot\frac{xy' - y}{x^2} &= \frac{1}{x} \\ \cos\frac{y}{x}\,(xy' - y) &= x \\ x\cos\frac{y}{x}\,y' &= y\cos\frac{y}{x} + x, \end{aligned}

    which is the given equation, for every CC⁠.

    X Y X′ Y′ (1, 0) C = 1 C = 2 y = (π/2)x y = −(π/2)x O
    Slope field of the equation between the rays y=±π2xy = \pm\frac{\pi}{2}x (x>0x > 0⁠), with equal scales, and the curves y=xsin⁡−1(log⁡Cx)y = x\sin^{-1}(\log Cx) for C=1C = 1 and C=2C = 2 (the part of sin⁡yx=log⁡Cx\sin\frac{y}{x} = \log Cx with −π2≤yx≤π2-\frac{\pi}{2} \le \frac{y}{x} \le \frac{\pi}{2}⁠). Each curve ends on the dashed rays y=±π2xy = \pm\frac{\pi}{2}x⁠, where cos⁡yx=0\cos\frac{y}{x} = 0 and the tangent is vertical.
    Getting the equation back proves the answer. The picture adds two facts the formula hides: since −1≤sin⁡yx≤1-1 \le \sin\frac{y}{x} \le 1⁠, a curve exists only where −1≤log⁡∣Cx∣≤1-1 \le \log|Cx| \le 1⁠; and it stops where cos⁡yx=0\cos\frac{y}{x} = 0⁠, the points Step 1 showed no solution can pass through.
    Implicit differentiation and the quotient rule for yx\frac{y}{x} (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 sin⁡(yx)=log⁡∣Cx∣\sin\left(\frac{y}{x}\right) = \log|Cx|⁠, where C≠0C \ne 0 is an arbitrary constant (x≠0x \ne 0⁠). (Textbook answer: sin⁡(yx)=log⁡∣Cx∣\sin\left(\frac{y}{x}\right) = \log|Cx|⁠.)

Check it with numbers

Take C=1C = 1 and x=2x = 2⁠. Then log⁡2≈0.6931472\log 2 \approx 0.6931472⁠, and the curve has y=2sin⁡−1(log⁡2)≈1.5316924y = 2\sin^{-1}(\log 2) \approx 1.5316924⁠, so yx≈0.7658462\frac{y}{x} \approx 0.7658462 and sin⁡yx≈0.6931472=log⁡2\sin\frac{y}{x} \approx 0.6931472 = \log 2⁠.

With cos⁡yx≈0.7207961\cos\frac{y}{x} \approx 0.7207961⁠, the equation gives the slope ycos⁡yx+xxcos⁡yx≈2.15320\frac{y\cos\frac{y}{x} + x}{x\cos\frac{y}{x}} \approx 2.15320⁠. The curve itself: y(2.001)≈1.5338464007y(2.001) \approx 1.5338464007 and y(1.999)≈1.5295399977y(1.999) \approx 1.5295399977⁠, so

1.5338464007−1.52953999770.002≈2.15320.\begin{aligned} &\frac{1.5338464007 - 1.5295399977}{0.002} \\ &\approx 2.15320. \end{aligned}
Common mistakes
  1. Writing dydx=xdvdx\frac{dy}{dx} = x\frac{dv}{dx}; the product rule gives v+xdvdxv + x\frac{dv}{dx}⁠.
  2. Scaling the inside of the cosine: cos⁡λyλx=cos⁡yx\cos\frac{\lambda y}{\lambda x} = \cos\frac{y}{x}⁠; no λ\lambda comes out of it.
  3. Writing sin⁡v=log⁡∣x∣+C\sin v = \log|x| + C and then log⁡∣Cx∣\log|Cx| without saying the constant was written as log⁡∣C∣\log|C|⁠.
  4. Leaving vv in the answer. Put v=yxv = \frac{y}{x} back.
What to take away
  1. When yy and xx appear inside a function only as yx\frac{y}{x}⁠, and the remaining terms all have the same degree, think "homogeneous, put y=vxy = vx".
  2. When the other side ends in a log, write the constant as log⁡∣C∣\log|C| so the logs combine.
  3. Check an implicit answer by differentiating it back.

Every fact used, and where it comes from

FactUsed inSource
Homogeneous function of degree zero; homogeneous equationSteps 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) - vSteps 3, 4Section 9.4.2, equations (2) to (4) (Lesson)
Separating the variablesStep 5Section 9.4.1 (Basics)
∫cos⁡v dv=sin⁡v+C\int\cos v\,dv = \sin v + C⁠; ∫dxx=log⁡∣x∣+C\int\frac{dx}{x} = \log|x| + CStep 6Section 7.2, formulas (ii) and (xii) (Basics)
The constant written as log⁡∣C∣\log|C|⁠; log⁡∣x∣+log⁡∣C∣=log⁡∣Cx∣\log|x| + \log|C| = \log|Cx|Step 6Chapter 5, Section 5.4 (Basics)
Implicit differentiation; quotient rule; (sin⁡u)′=cos⁡u⋅u′(\sin u)' = \cos u\cdot u'Step 7Chapter 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 →