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

Exercise 9.5 · Q6: Linear: xdydx+2y=x2log⁡xx\frac{dy}{dx} + 2y = x^2\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:

6. xdydx+2y=x2log⁡xx\dfrac{dy}{dx} + 2y = x^2\log x

Exam answer

Here x>0x > 0⁠. Dividing both sides by xx⁠,

dydx+2x y=xlog⁡x\frac{dy}{dx} + \frac{2}{x}\,y = x\log x

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

I.F.=e∫2xdx=e2log⁡x=elog⁡x2=x2\begin{aligned} \text{I.F.} &= e^{\int\frac{2}{x}dx} = e^{2\log x} \\ &= e^{\log x^2} = x^2 \end{aligned}

So the solution is given by

y⋅x2=∫xlog⁡x⋅x2 dx+C=∫x3log⁡x dx+C\begin{aligned} y\cdot x^2 &= \int x\log x\cdot x^2\,dx + C \\ &= \int x^3\log x\,dx + C \end{aligned}

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

x2y=log⁡x⋅x44−∫1x⋅x44 dx+C=x44log⁡x−∫x34 dx+C=x44log⁡x−x416+C=x416(4log⁡x−1)+C\begin{aligned} x^2y &= \log x\cdot\frac{x^4}{4} \\ &\quad - \int\frac{1}{x}\cdot\frac{x^4}{4}\,dx + C \\ &= \frac{x^4}{4}\log x - \int\frac{x^3}{4}\,dx + C \\ &= \frac{x^4}{4}\log x - \frac{x^4}{16} + C \\ &= \frac{x^4}{16}(4\log x - 1) + C \end{aligned}

Dividing by x2x^2⁠,

∴\therefore y=x216(4log⁡x−1)y = \dfrac{x^2}{16}(4\log x - 1) + Cx−2+\ Cx^{-2} is the general solution.

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

The one idea this problem is built on

This is Example 15 with x2log⁡xx^2\log x on the right instead of x2x^2⁠. Divide by xx to get the standard form with P=2xP = \frac{2}{x}⁠, so the integrating factor is x2x^2⁠. The integral that remains, ∫x3log⁡x dx\int x^3\log x\,dx⁠, is done by parts with log⁡x\log x as the first function.

Given, to find, and the plan
Given
xdydx+2y=x2log⁡xx\frac{dy}{dx} + 2y = x^2\log x⁠; log⁡x\log x is defined only for x>0x > 0⁠.
To find
The general solution (one arbitrary constant).
Plan
(1) Divide by xx⁠. (2) Read off PP⁠, QQ⁠. (3) I.F. =e∫P dx= e^{\int P\,dx}⁠. (4) Multiply and integrate, with one constant. (5) ∫x3log⁡x dx\int x^3\log x\,dx by parts. (6) Solve for yy⁠. (7) Check, and compare with the key's log⁡∣x∣\log|x|⁠.

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

2Logs and exponentials

2log⁡x=log⁡x22\log x = \log x^2 and elog⁡t=te^{\log t} = t for t>0t > 0⁠. Basics: exponentials

3Integration by parts, ILATE

∫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⁠; a logarithm is taken as the first function, because its derivative 1x\frac{1}{x} is simpler and we cannot easily integrate it (Section 7.6). Basics: every method ends with an integral

4One constant

A first order equation has one arbitrary constant in its general solution (chapter Summary). Basics: one constant for order 1

Solution

  1. Divide by xx to reach the standard form

    dydx+2x y=xlog⁡x.\frac{dy}{dx} + \frac{2}{x}\,y = x\log x.
    Because of log⁡x\log x⁠, the equation only makes sense for x>0x > 0⁠; there x≠0x \ne 0⁠, so dividing by xx is allowed, and x2log⁡xx=xlog⁡x\frac{x^2\log x}{x} = x\log x⁠.
    Section 9.4.3, step (i). Lesson: linear equations
  2. Read off PP and QQ

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

    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. The integrating factor: x2x^2

    I.F.=e∫2x dx=e2log⁡∣x∣=e2log⁡x=elog⁡x2=x2.\begin{aligned} \text{I.F.} &= e^{\int\frac{2}{x}\,dx} = e^{2\log|x|} \\ &= e^{2\log x} = e^{\log x^2} = x^2. \end{aligned}
    For x>0x > 0⁠, ∣x∣=x|x| = x⁠; then 2log⁡x=log⁡x22\log x = \log x^2 and elog⁡t=te^{\log t} = t⁠. (Even for negative xx the result would be x2x^2⁠, since ∣x∣2=x2|x|^2 = x^2⁠.)
    Section 9.4.3, step (ii); Section 7.2, formula (xii). Basics: exponentials
  4. Multiply and integrate, with one constant

    ddx(x2y)=x2⋅xlog⁡x=x3log⁡x,x2y=∫x3log⁡x dx+C.\begin{aligned} \frac{d}{dx}\left(x^2y\right) &= x^2\cdot x\log x = x^3\log x, \\ x^2y &= \int x^3\log x\,dx + C. \end{aligned}
    x2dydx+2x y=ddx(x2y)x^2\frac{dy}{dx} + 2x\,y = \frac{d}{dx}(x^2y) by the product rule. 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)
  5. ∫x3log⁡x dx\int x^3\log x\,dx by parts

    Take log⁡x\log x as the first function and x3x^3 as the second, so ∫x3 dx=x44\int x^3\,dx = \frac{x^4}{4}⁠:

    ∫x3log⁡x dx=log⁡x⋅x44−∫1x⋅x44 dx=x44log⁡x−x416=x416(4log⁡x−1).\begin{aligned} &\int x^3\log x\,dx \\ &= \log x\cdot\frac{x^4}{4} - \int\frac{1}{x}\cdot\frac{x^4}{4}\,dx \\ &= \frac{x^4}{4}\log x - \frac{x^4}{16} \\ &= \frac{x^4}{16}(4\log x - 1). \end{aligned}
    1x⋅x44=x34\frac{1}{x}\cdot\frac{x^4}{4} = \frac{x^3}{4}⁠, whose integral is x416\frac{x^4}{16}⁠. Taking x416\frac{x^4}{16} out as a common factor gives the tidy form. Check: the derivative of x44log⁡x−x416\frac{x^4}{4}\log x - \frac{x^4}{16} is x3log⁡x+x34−x34x^3\log x + \frac{x^3}{4} - \frac{x^3}{4} =x3log⁡x= x^3\log x⁠.
    Section 7.6, integration by parts; Section 7.2, formula (i). Basics: every method ends with an integral
  6. Solve for yy

    x2y=x416(4log⁡x−1)+Cy=x216(4log⁡x−1)+Cx−2.\begin{aligned} x^2y &= \frac{x^4}{16}(4\log x - 1) + C \\ y &= \frac{x^2}{16}(4\log x - 1) + Cx^{-2}. \end{aligned}
    Divide by x2>0x^2 > 0⁠; Cx2=Cx−2\frac{C}{x^2} = Cx^{-2}⁠.
    Section 9.4.3: the general solution. Lesson: Exercise 9.5 player
  7. Check by substituting back, and the key's log⁡∣x∣\log|x|

    From y=x24log⁡x−x216+Cx−2y = \frac{x^2}{4}\log x - \frac{x^2}{16} + Cx^{-2}⁠: dydx=x2log⁡x+x4−x8−2Cx−3\frac{dy}{dx} = \frac{x}{2}\log x + \frac{x}{4} - \frac{x}{8} - 2Cx^{-3}⁠, so

    xdydx=x22log⁡x+x28−2Cx−2,2y=x22log⁡x−x28+2Cx−2,\begin{aligned} x\frac{dy}{dx} &= \frac{x^2}{2}\log x + \frac{x^2}{8} - 2Cx^{-2}, \\ 2y &= \frac{x^2}{2}\log x - \frac{x^2}{8} + 2Cx^{-2}, \end{aligned}

    and adding, xdydx+2y=x2log⁡xx\frac{dy}{dx} + 2y = x^2\log x⁠, for every CC⁠.

    The derivative of x24log⁡x\frac{x^2}{4}\log x is x2log⁡x+x24⋅1x\frac{x}{2}\log x + \frac{x^2}{4}\cdot\frac{1}{x} by the product rule. The answer key writes log⁡∣x∣\log|x| in place of log⁡x\log x⁠; since the equation itself needs x>0x > 0⁠, where log⁡∣x∣=log⁡x\log|x| = \log x⁠, the two answers are the same.
    A solution makes L.H.S. = R.H.S. (Section 9.3). Lesson: general and particular solutions
Result

The general solution is y=x216(4log⁡x−1)+Cx−2y = \frac{x^2}{16}(4\log x - 1) + Cx^{-2}⁠, where CC is an arbitrary constant, for x>0x > 0⁠. (Textbook answer: y=x216(4log⁡∣x∣−1)+Cx−2y = \frac{x^2}{16}(4\log|x| - 1) + Cx^{-2}⁠, the same for x>0x > 0⁠.)

Check it with numbers

Take C=1C = 1 and x=2x = 2⁠: log⁡2≈0.6931472\log 2 \approx 0.6931472⁠, so y=416(4log⁡2−1)+14y = \frac{4}{16}(4\log 2 - 1) + \frac14 =log⁡2≈0.6931472= \log 2 \approx 0.6931472⁠. The equation says dydx=x2log⁡x−2yx\frac{dy}{dx} = \frac{x^2\log x - 2y}{x} =4log⁡2−2log⁡22=log⁡2= \frac{4\log 2 - 2\log 2}{2} = \log 2⁠.

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

0.6938410009−0.69245470670.002≈0.69315.\begin{aligned} &\frac{0.6938410009 - 0.6924547067}{0.002} \\ &\approx 0.69315. \end{aligned}
Common mistakes
  1. Reading P=2P = 2 and Q=x2log⁡xQ = x^2\log x without dividing by xx first.
  2. Taking x3x^3 as the first function in ∫x3log⁡x dx\int x^3\log x\,dx⁠: that needs ∫log⁡x dx\int\log x\,dx and goes round in circles.
  3. ∫x34 dx=x44\int\frac{x^3}{4}\,dx = \frac{x^4}{4}: it is x416\frac{x^4}{16}⁠.
  4. Dividing only part of the right side by x2x^2⁠: the constant becomes Cx−2Cx^{-2}⁠.
What to take away
  1. xdydx+ky=…x\frac{dy}{dx} + ky = \ldots⁠: divide by xx⁠, and the I.F. is xkx^k⁠.
  2. ∫xnlog⁡x dx\int x^n\log x\,dx⁠: by parts with log⁡x\log x first.
  3. Look at what the equation itself requires (here x>0x > 0⁠) before worrying about ∣x∣|x|⁠.

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 to 4Section 9.4.3, steps (i) to (iii) (Lesson)
∫dxx=log⁡∣x∣\int\frac{dx}{x} = \log|x|⁠; elog⁡t=te^{\log t} = tStep 3Section 7.2, formula (xii); Chapter 5, Section 5.4 (Basics)
Product ruleSteps 4, 7Chapter 5, Section 5.3 (Basics)
Integration by parts; ∫xn dx=xn+1n+1+C\int x^n\,dx = \frac{x^{n+1}}{n+1} + CStep 5Section 7.6; Section 7.2, formula (i) (Basics)
Substituting back into the equationStep 7Section 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 →