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

Exercise 9.5 · Q7: Linear: xlog⁡xdydx+y=2xlog⁡xx\log x\frac{dy}{dx} + y = \frac{2}{x}\log x

Exercise 9.5Linear differential equations · Section 9.4.3
The question

For each of the differential equations given in Exercises 1 to 12, find the general solution:

7. xlog⁡x dydx+y=2xlog⁡xx\log x\,\dfrac{dy}{dx} + y = \dfrac{2}{x}\log x

Exam answer

Here x>0x > 0⁠, x≠1x \ne 1⁠. Dividing both sides by xlog⁡xx\log x⁠,

dydx+yxlog⁡x=2x2\frac{dy}{dx} + \frac{y}{x\log x} = \frac{2}{x^2}

This is of the form dydx+Py=Q\frac{dy}{dx} + Py = Q⁠, where P=1xlog⁡xP = \frac{1}{x\log x} and Q=2x2Q = \frac{2}{x^2}⁠.

Put log⁡x=t\log x = t⁠. Then 1x dx=dt\frac{1}{x}\,dx = dt⁠.

∫dxxlog⁡x=∫dtt=log⁡∣t∣=log⁡∣log⁡x∣\begin{aligned} \int\frac{dx}{x\log x} &= \int\frac{dt}{t} \\ &= \log|t| = \log|\log x| \end{aligned} I.F.=elog⁡∣log⁡x∣=∣log⁡x∣\text{I.F.} = e^{\log|\log x|} = |\log x|

The sign of log⁡x\log x is constant on 0<x<10 < x < 1 and on x>1x > 1⁠, so we take I.F.=log⁡x\text{I.F.} = \log x⁠. The solution is given by

ylog⁡x=∫2x2log⁡x dx+Cy\log x = \int\frac{2}{x^2}\log x\,dx + C

Integrating by parts with log⁡x\log x as the first function,

ylog⁡x=log⁡x⋅(−2x)−∫1x⋅(−2x)dx+C=−2xlog⁡x+∫2x2 dx+C=−2xlog⁡x−2x+C\begin{aligned} y\log x &= \log x\cdot\left(-\frac{2}{x}\right) \\ &\quad - \int\frac{1}{x}\cdot\left(-\frac{2}{x}\right)dx + C \\ &= -\frac{2}{x}\log x + \int\frac{2}{x^2}\,dx + C \\ &= -\frac{2}{x}\log x - \frac{2}{x} + C \end{aligned}

∴\therefore ylog⁡x=−2x(1+log⁡x)+Cy\log x = -\dfrac{2}{x}(1 + \log x) + C is the general solution.

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

The one idea this problem is built on

Divide by xlog⁡xx\log x to reach the standard form: P=1xlog⁡xP = \frac{1}{x\log x}⁠, Q=2x2Q = \frac{2}{x^2}⁠. (The book lists dydx+yxlog⁡x=1x\frac{dy}{dx} + \frac{y}{x\log x} = \frac{1}{x} as an example of a linear equation in Section 9.4.3; this is the same PP⁠.) The substitution t=log⁡xt = \log x gives ∫P dx=log⁡∣log⁡x∣\int P\,dx = \log|\log x|⁠, so log⁡x\log x serves as the integrating factor. The remaining integral ∫2x2log⁡x dx\int\frac{2}{x^2}\log x\,dx is done by parts with log⁡x\log x first.

Given, to find, and the plan
Given
xlog⁡x dydx+y=2xlog⁡xx\log x\,\frac{dy}{dx} + y = \frac{2}{x}\log x⁠; log⁡x\log x needs x>0x > 0⁠.
To find
The general solution (one arbitrary constant).
Plan
(1) Divide by xlog⁡xx\log x (needs x≠1x \ne 1 too). (2) Read off PP⁠, QQ⁠. (3) ∫P dx\int P\,dx by t=log⁡xt = \log x⁠; the I.F., with care over ∣log⁡x∣|\log x|⁠. (4) Multiply and integrate, with one constant. (5) By parts. (6) Check, and look at x=1x = 1⁠.

Basics you need

1The standard linear form

dydx+Py=Q\frac{dy}{dx} + Py = Q with PP⁠, QQ functions of xx only; make the coefficient of dydx\frac{dy}{dx} equal to 1 first. Solution: y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠, I.F.=e∫P dx\text{I.F.} = e^{\int P\,dx} (Section 9.4.3). Lesson: linear equations, the integrating factor

2Substitution

With t=log⁡xt = \log x⁠, dt=dxxdt = \frac{dx}{x}⁠, so ∫dxxlog⁡x=∫dtt=log⁡∣t∣\int\frac{dx}{x\log x} = \int\frac{dt}{t} = \log|t| (Section 7.3.1; Section 7.2, formula (xii)). Basics: every method ends with an integral

3A constant multiple of an I.F. is an I.F.

If gg is an integrating factor, so is kgkg for any constant k≠0k \ne 0⁠; so log⁡x\log x can replace ∣log⁡x∣|\log x|⁠. Basics: (y · g)′ = g(y′ + Py)

4Integration by parts

∫f g dx=f∫g dx−∫(f′∫g dx)dx\int f\,g\,dx = f\int g\,dx - \int\left(f'\int g\,dx\right)dx⁠, with log⁡x\log x as the first function (Section 7.6). Basics: every method ends with an integral

Solution

  1. Where the equation lives, and the standard form

    dydx+1xlog⁡x y=2x2.\frac{dy}{dx} + \frac{1}{x\log x}\,y = \frac{2}{x^2}.
    log⁡x\log x needs x>0x > 0⁠. To divide by xlog⁡xx\log x we also need log⁡x≠0\log x \ne 0⁠, that is x≠1x \ne 1⁠. So we work on 0<x<10 < x < 1 or on x>1x > 1⁠. On the right, 2xlog⁡x÷xlog⁡x=2x2\frac{2}{x}\log x \div x\log x = \frac{2}{x^2}⁠.
    Section 9.4.3, step (i). Lesson: linear equations
  2. Read off PP and QQ

    P=1xlog⁡xP = \frac{1}{x\log x} and Q=2x2Q = \frac{2}{x^2}⁠.

    Both depend on xx only, and yy appears to the first power, so the equation is linear.
    Section 9.4.3: PP and QQ are constants or functions of xx only. Lesson: linear equations
  3. ∫P dx\int P\,dx by the substitution t=log⁡xt = \log x

    Put log⁡x=t\log x = t⁠, so 1x dx=dt\frac{1}{x}\,dx = dt⁠:

    ∫dxxlog⁡x=∫dtt=log⁡∣t∣=log⁡∣log⁡x∣.\begin{aligned} \int\frac{dx}{x\log x} &= \int\frac{dt}{t} \\ &= \log|t| = \log|\log x|. \end{aligned}
    dxxlog⁡x\frac{dx}{x\log x} is 1log⁡x\frac{1}{\log x} times dxx\frac{dx}{x}⁠, and dxx\frac{dx}{x} is exactly dtdt⁠. The modulus stays because log⁡x\log x is negative on 0<x<10 < x < 1⁠.
    Section 7.3.1 (substitution); Section 7.2, formula (xii). Basics: every method ends with an integral
  4. The integrating factor: log⁡x\log x

    I.F.=elog⁡∣log⁡x∣=∣log⁡x∣.\text{I.F.} = e^{\log|\log x|} = |\log x|.

    We take I.F.=log⁡x\text{I.F.} = \log x⁠, as the book does.

    For x>1x > 1⁠, log⁡x>0\log x > 0 and ∣log⁡x∣=log⁡x|\log x| = \log x⁠. For 0<x<10 < x < 1⁠, ∣log⁡x∣=−log⁡x|\log x| = -\log x⁠, a constant multiple (−1-1⁠) of log⁡x\log x⁠, and a nonzero constant multiple of an integrating factor is again one. So log⁡x\log x works on both intervals. Indeed ddx(log⁡x)=1x=P⋅log⁡x\frac{d}{dx}(\log x) = \frac{1}{x} = P\cdot\log x⁠.
    Section 9.4.3, step (ii). Basics: exponentials
  5. Multiply and integrate, with one constant

    log⁡x dydx+yx=2x2log⁡xddx(ylog⁡x)=2x2log⁡xylog⁡x=∫2x2log⁡x dx+C.\begin{aligned} \log x\,\frac{dy}{dx} + \frac{y}{x} &= \frac{2}{x^2}\log x \\ \frac{d}{dx}(y\log x) &= \frac{2}{x^2}\log x \\ y\log x &= \int\frac{2}{x^2}\log x\,dx + C. \end{aligned}
    By the product rule, ddx(ylog⁡x)=log⁡x dydx+y⋅1x\frac{d}{dx}(y\log x) = \log x\,\frac{dy}{dx} + y\cdot\frac{1}{x}⁠, the left side. Integrating gives y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + C⁠, with the one constant CC⁠.
    Section 9.4.3, step (iii); product rule (Chapter 5, Section 5.3). Basics: (y · g)′ = g(y′ + Py)
  6. ∫2x2log⁡x dx\int\frac{2}{x^2}\log x\,dx by parts

    Take log⁡x\log x as the first function and 2x2\frac{2}{x^2} as the second, so ∫2x2 dx=−2x\int\frac{2}{x^2}\,dx = -\frac{2}{x}⁠:

    ∫2x2log⁡x dx=log⁡x⋅(−2x)−∫1x(−2x)dx=−2xlog⁡x+∫2x2 dx=−2xlog⁡x−2x=−2x(1+log⁡x).\begin{aligned} &\int\frac{2}{x^2}\log x\,dx \\ &= \log x\cdot\left(-\frac{2}{x}\right) \\ &\quad - \int\frac{1}{x}\left(-\frac{2}{x}\right)dx \\ &= -\frac{2}{x}\log x + \int\frac{2}{x^2}\,dx \\ &= -\frac{2}{x}\log x - \frac{2}{x} \\ &= -\frac{2}{x}(1 + \log x). \end{aligned}
    ∫2x−2 dx=2x−1−1=−2x\int 2x^{-2}\,dx = \frac{2x^{-1}}{-1} = -\frac{2}{x} by the power rule. Check: the derivative of −2x(1+log⁡x)-\frac{2}{x}(1 + \log x) is 2x2(1+log⁡x)−2x⋅1x\frac{2}{x^2}(1 + \log x) - \frac{2}{x}\cdot\frac{1}{x} =2x2log⁡x= \frac{2}{x^2}\log x⁠.
    Section 7.6, integration by parts; Section 7.2, formula (i). Basics: every method ends with an integral
  7. The general solution

    ylog⁡x=−2x(1+log⁡x)+C.y\log x = -\frac{2}{x}(1 + \log x) + C.
    This is the book's form. Solved for yy⁠: y=C−2x(1+log⁡x)log⁡xy = \dfrac{C - \frac{2}{x}(1 + \log x)}{\log x}⁠, on 0<x<10 < x < 1 or on x>1x > 1⁠. At x=1x = 1 the given equation reads 0+y=00 + y = 0⁠, so a solution can only reach x=1x = 1 with y=0y = 0⁠; in the family that happens only for C=2C = 2⁠, where C−2x(1+log⁡x)C - \frac{2}{x}(1 + \log x) also vanishes at x=1x = 1⁠.
    Section 9.4.3: the general solution. Lesson: Exercise 9.5 player
  8. Check by substituting back

    Differentiate ylog⁡x=−2x(1+log⁡x)+Cy\log x = -\frac{2}{x}(1 + \log x) + C on both sides:

    log⁡x dydx+yx=2x2(1+log⁡x)−2x2=2x2log⁡x.\begin{aligned} \log x\,\frac{dy}{dx} + \frac{y}{x} &= \frac{2}{x^2}(1 + \log x) - \frac{2}{x^2} \\ &= \frac{2}{x^2}\log x. \end{aligned}

    Multiplying by xx⁠: xlog⁡x dydx+y=2xlog⁡xx\log x\,\frac{dy}{dx} + y = \frac{2}{x}\log x⁠, the given equation, for every CC⁠.

    Differentiating the solution in the form y (I.F.)=…y\,(\text{I.F.}) = \ldots gives back the multiplied equation, and multiplying by xx gives the original one. The constant disappears on differentiation, as it must.
    A solution makes L.H.S. = R.H.S. (Section 9.3); product and quotient rules (Chapter 5). Lesson: general and particular solutions
Result

The general solution is ylog⁡x=−2x(1+log⁡x)+Cy\log x = -\frac{2}{x}(1 + \log x) + C⁠, where CC is an arbitrary constant, for x>0x > 0⁠, x≠1x \ne 1⁠. (Textbook answer: ylog⁡x=−2x(1+log⁡∣x∣)+Cy\log x = \frac{-2}{x}(1 + \log|x|) + C⁠, the same, since log⁡∣x∣=log⁡x\log|x| = \log x for x>0x > 0⁠.)

Check it with numbers

Take C=3C = 3 and x=2x = 2⁠: log⁡2≈0.6931472\log 2 \approx 0.6931472⁠, so ylog⁡2=3−(1+log⁡2)=2−log⁡2y\log 2 = 3 - (1 + \log 2) = 2 - \log 2 and y=2log⁡2−1≈1.8853901y = \frac{2}{\log 2} - 1 \approx 1.8853901⁠. The equation says dydx=2xlog⁡x−yxlog⁡x=log⁡2−y2log⁡2\frac{dy}{dx} = \frac{\frac{2}{x}\log x - y}{x\log x} = \frac{\log 2 - y}{2\log 2} ≈−0.8600215\approx -0.8600215⁠.

The curve itself: y(2.001)≈1.8845309501y(2.001) \approx 1.8845309501 and y(1.999)≈1.8862509949y(1.999) \approx 1.8862509949⁠, so

1.8845309501−1.88625099490.002≈−0.86002.\begin{aligned} &\frac{1.8845309501 - 1.8862509949}{0.002} \\ &\approx -0.86002. \end{aligned}
Common mistakes
  1. Dividing by xx only, which leaves log⁡x dydx\log x\,\frac{dy}{dx}⁠; the coefficient of dydx\frac{dy}{dx} must be 1, so divide by xlog⁡xx\log x⁠.
  2. Writing ∫dxxlog⁡x=log⁡x\int\frac{dx}{x\log x} = \log x; with t=log⁡xt = \log x it is log⁡∣log⁡x∣\log|\log x|⁠, so the I.F. is log⁡x\log x⁠, not xx⁠.
  3. ∫2x2 dx=2x\int\frac{2}{x^2}\,dx = \frac{2}{x}: the sign is wrong; it is −2x-\frac{2}{x}⁠.
  4. Forgetting x≠1x \ne 1⁠: the division by log⁡x\log x needs it.
What to take away
  1. P=1xlog⁡xP = \frac{1}{x\log x} gives the I.F. log⁡x\log x (from ∫P dx=log⁡∣log⁡x∣\int P\,dx = \log|\log x|⁠).
  2. When the I.F. comes out as ∣g(x)∣|g(x)|⁠, g(x)g(x) itself can be used: the sign is a constant on each interval.
  3. Differentiating y (I.F.)=∫…+Cy\,(\text{I.F.}) = \int\ldots + C back is a quick check of the whole solution.

Every fact used, and where it comes from

FactUsed inSource
Standard linear form; I.F. =e∫P dx= e^{\int P\,dx}⁠; y (I.F.)=∫(Q×I.F.) dx+Cy\,(\text{I.F.}) = \int(Q\times\text{I.F.})\,dx + CSteps 1, 2, 4, 5Section 9.4.3, steps (i) to (iii) (Lesson)
Substitution; ∫dtt=log⁡∣t∣\int\frac{dt}{t} = \log|t|Step 3Section 7.3.1; Section 7.2, formula (xii) (Basics)
elog⁡t=te^{\log t} = t for t>0t > 0Step 4Chapter 5, Section 5.4 (Basics)
Product rule; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac{1}{x}Steps 5, 8Chapter 5, Sections 5.3 and 5.4 (Basics)
Integration by parts; power ruleStep 6Section 7.6; Section 7.2, formula (i) (Basics)
Substituting back into the equationStep 8Section 9.3 (Lesson)
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 →