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

Exercise 9.5 · Q8: Linear: (1+x2) dy+2xy dx=cot⁡x dx(1 + x^2)\,dy + 2xy\,dx = \cot x\,dx

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:

8. (1+x2) dy+2xy dx=cot⁡x dx (x≠0)(1 + x^2)\,dy + 2xy\,dx = \cot x\,dx\ (x \ne 0)

Exam answer

Dividing both sides by (1+x2) dx(1 + x^2)\,dx⁠,

dydx+2x1+x2 y=cot⁡x1+x2\frac{dy}{dx} + \frac{2x}{1 + x^2}\,y = \frac{\cot x}{1 + x^2}

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

I.F.=e∫2x1+x2dx=elog⁡(1+x2)=1+x2\begin{aligned} \text{I.F.} &= e^{\int\frac{2x}{1 + x^2}dx} \\ &= e^{\log(1 + x^2)} = 1 + x^2 \end{aligned}

So the solution is given by

y(1+x2)=∫cot⁡x1+x2⋅(1+x2) dx+C=∫cot⁡x dx+C=log⁡∣sin⁡x∣+C\begin{aligned} y(1 + x^2) &= \int\frac{\cot x}{1 + x^2}\cdot(1 + x^2)\,dx \\ &\qquad + C \\ &= \int\cot x\,dx + C \\ &= \log|\sin x| + C \end{aligned}

Dividing by 1+x21 + x^2⁠,

∴\therefore y=(1+x2)−1log⁡∣sin⁡x∣y = (1 + x^2)^{-1}\log|\sin x| + C(1+x2)−1+\ C(1 + x^2)^{-1} is the general solution (sin⁡x≠0)(\sin x \ne 0)⁠.

The answer key prints (1+x)−1(1 + x)^{-1} in the first term; it should be (1+x2)−1(1 + x^2)^{-1}⁠.

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

The one idea this problem is built on

Divide by (1+x2) dx(1 + x^2)\,dx to reach dydx+Py=Q\frac{dy}{dx} + Py = Q with P=2x1+x2P = \frac{2x}{1 + x^2}⁠. The top of PP is the derivative of the bottom, so ∫P dx=log⁡(1+x2)\int P\,dx = \log(1 + x^2) and the integrating factor is 1+x21 + x^2⁠. In fact the left side of the given equation, (1+x2) dy+2xy dx(1 + x^2)\,dy + 2xy\,dx⁠, is already d[y(1+x2)]d\big[y(1 + x^2)\big]⁠: multiplying by the I.F. just undoes the division.

Given, to find, and the plan
Given
(1+x2) dy+2xy dx=cot⁡x dx(1 + x^2)\,dy + 2xy\,dx = \cot x\,dx⁠, with the book's condition x≠0x \ne 0⁠.
To find
The general solution (one arbitrary constant).
Plan
(1) Divide by (1+x2) dx(1 + x^2)\,dx⁠. (2) Read off PP⁠, QQ⁠; note where cot⁡x\cot x is defined. (3) I.F. =e∫P dx= e^{\int P\,dx}⁠. (4) Multiply and integrate, with one constant. (5) Solve for yy⁠. (6) Check, and compare with the key.

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

2"Derivative over function"

With t=1+x2t = 1 + x^2⁠, dt=2x dxdt = 2x\,dx⁠, so ∫2x1+x2 dx=log⁡∣1+x2∣=log⁡(1+x2)\int\frac{2x}{1 + x^2}\,dx = \log|1 + x^2| = \log(1 + x^2) (Section 7.3.1). Basics: every method ends with an integral

3∫cot⁡x dx=log⁡∣sin⁡x∣+C\int\cot x\,dx = \log|\sin x| + C

Since cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x} and the top is the derivative of the bottom (Section 7.3.1). Basics: every method ends with an integral

4Why the I.F. works

g=1+x2g = 1 + x^2 has g′=2x=2x1+x2⋅gg' = 2x = \frac{2x}{1 + x^2}\cdot g⁠, so g y′+Pg y=(yg)′g\,y' + Pg\,y = (yg)'⁠. Basics: (y · g)′ = g(y′ + Py)

Solution

  1. Divide by (1+x2) dx(1 + x^2)\,dx to reach the standard form

    dydx+2x1+x2 y=cot⁡x1+x2.\frac{dy}{dx} + \frac{2x}{1 + x^2}\,y = \frac{\cot x}{1 + x^2}.
    1+x2≥11 + x^2 \ge 1⁠, so it is never zero and the division is always allowed. Dividing the differentials by dxdx turns dydy into dydx\frac{dy}{dx}⁠.
    Section 9.4.3, step (i). Lesson: linear equations
  2. Read off PP and QQ⁠, and where they are defined

    P=2x1+x2P = \frac{2x}{1 + x^2} and Q=cot⁡x1+x2Q = \frac{\cot x}{1 + x^2}⁠.

    Both depend on xx only, so the equation is linear. QQ contains cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x}⁠, so we need sin⁡x≠0\sin x \ne 0⁠, that is x≠nπx \ne n\pi for every integer nn⁠. The book writes "(x≠0)(x \ne 0)"; the condition actually needed is sin⁡x≠0\sin x \ne 0⁠, which includes x≠0x \ne 0⁠. The solution lives on an interval between consecutive multiples of π\pi⁠, such as 0<x<π0 < x < \pi⁠.
    Section 9.4.3: PP and QQ are constants or functions of xx only. Lesson: linear equations
  3. The integrating factor: 1+x21 + x^2

    I.F.=e∫2x1+x2 dx=elog⁡(1+x2)=1+x2.\text{I.F.} = e^{\int\frac{2x}{1 + x^2}\,dx} = e^{\log(1 + x^2)} = 1 + x^2.
    Put t=1+x2t = 1 + x^2⁠, dt=2x dxdt = 2x\,dx⁠: ∫dtt=log⁡∣t∣=log⁡(1+x2)\int\frac{dt}{t} = \log|t| = \log(1 + x^2)⁠, and no modulus is needed because 1+x2>01 + x^2 > 0⁠. Then elog⁡t=te^{\log t} = t⁠.
    Section 9.4.3, step (ii); Section 7.3.1. Basics: exponentials
  4. Multiply and integrate, with one constant

    ddx[y(1+x2)]=cot⁡x,y(1+x2)=∫cot⁡x dx+C=log⁡∣sin⁡x∣+C.\begin{aligned} \frac{d}{dx}\big[y(1 + x^2)\big] &= \cot x, \\ y(1 + x^2) &= \int\cot x\,dx + C \\ &= \log|\sin x| + C. \end{aligned}
    By the product rule, ddx[y(1+x2)]=(1+x2)dydx+2x y\frac{d}{dx}\big[y(1 + x^2)\big] = (1 + x^2)\frac{dy}{dx} + 2x\,y⁠, which is the left side times the I.F.; on the right, cot⁡x1+x2⋅(1+x2)=cot⁡x\frac{\cot x}{1 + x^2}\cdot(1 + x^2) = \cot x⁠. Then ∫cot⁡x dx=log⁡∣sin⁡x∣\int\cot x\,dx = \log|\sin x|⁠, and CC is the one constant.
    Section 9.4.3, step (iii); Section 7.3.1. Basics: (y · g)′ = g(y′ + Py)
  5. Solve for yy

    y=log⁡∣sin⁡x∣1+x2+C1+x2=(1+x2)−1log⁡∣sin⁡x∣+C(1+x2)−1.\begin{aligned} y &= \frac{\log|\sin x|}{1 + x^2} + \frac{C}{1 + x^2} \\ &= (1 + x^2)^{-1}\log|\sin x| \\ &\quad + C(1 + x^2)^{-1}. \end{aligned}
    Divide by 1+x2>01 + x^2 > 0⁠. Both terms get the same factor (1+x2)−1(1 + x^2)^{-1}⁠.
    Section 9.4.3: the general solution. Lesson: Exercise 9.5 player
  6. Check by substituting back

    From y(1+x2)=log⁡∣sin⁡x∣+Cy(1 + x^2) = \log|\sin x| + C⁠, differentiate both sides:

    (1+x2)dydx+2x y=cos⁡xsin⁡x=cot⁡x,(1 + x^2)\frac{dy}{dx} + 2x\,y = \frac{\cos x}{\sin x} = \cot x,

    which is (1+x2) dy+2xy dx=cot⁡x dx(1 + x^2)\,dy + 2xy\,dx = \cot x\,dx after multiplying by dxdx⁠, for every CC⁠.

    ddxlog⁡∣sin⁡x∣=cos⁡xsin⁡x\frac{d}{dx}\log|\sin x| = \frac{\cos x}{\sin x} on any interval where sin⁡x≠0\sin x \ne 0 (for sin⁡x<0\sin x < 0 too, by the chain rule on log⁡(−sin⁡x)\log(-\sin x)⁠).
    A solution makes L.H.S. = R.H.S. (Section 9.3). Lesson: general and particular solutions
  7. The answer key's first factor

    The answer key prints y=(1+x)−1log⁡∣sin⁡x∣y = (1 + x)^{-1}\log|\sin x| + C(1+x2)−1+\ C(1 + x^2)^{-1}⁠, with (1+x)−1(1 + x)^{-1} in the first term. Our Step 5 has (1+x2)−1(1 + x^2)^{-1} in both terms. Test the key's form with C=0C = 0⁠, y=log⁡sin⁡x1+xy = \frac{\log\sin x}{1 + x}⁠, at x=1x = 1⁠: there y=log⁡sin⁡12y = \frac{\log\sin 1}{2} and dydx=cot⁡12−log⁡sin⁡14\frac{dy}{dx} = \frac{\cot 1}{2} - \frac{\log\sin 1}{4}⁠, so

    (1+x2)dydx+2xy−cot⁡x=cot⁡1−log⁡sin⁡12+log⁡sin⁡1−cot⁡1=log⁡sin⁡12≈−0.0863019,\begin{aligned} &(1 + x^2)\frac{dy}{dx} + 2xy - \cot x \\ &= \cot 1 - \frac{\log\sin 1}{2} \\ &\quad + \log\sin 1 - \cot 1 \\ &= \frac{\log\sin 1}{2} \approx -0.0863019, \end{aligned}

    which is not 0.

    So the key's form does not satisfy the equation, while with (1+x2)−1(1 + x^2)^{-1} in both terms the check of Step 6 holds for every CC⁠. The key's (1+x)−1(1 + x)^{-1} is a misprint for (1+x2)−1(1 + x^2)^{-1}⁠; the second term of the key already has the right factor. (Near x=1x = 1⁠, sin⁡x>0\sin x > 0⁠, so ∣sin⁡x∣=sin⁡x|\sin x| = \sin x here.)
    Substituting back (Section 9.3). Basics: derivatives
Result

The general solution is y=(1+x2)−1log⁡∣sin⁡x∣y = (1 + x^2)^{-1}\log|\sin x| + C(1+x2)−1+\ C(1 + x^2)^{-1}⁠, that is y(1+x2)=log⁡∣sin⁡x∣+Cy(1 + x^2) = \log|\sin x| + C⁠, where CC is an arbitrary constant (sin⁡x≠0\sin x \ne 0⁠). (Textbook answer: y=(1+x)−1log⁡∣sin⁡x∣y = (1 + x)^{-1}\log|\sin x| + C(1+x2)−1+\ C(1 + x^2)^{-1}⁠, a misprint for y=(1+x2)−1log⁡∣sin⁡x∣y = (1 + x^2)^{-1}\log|\sin x| + C(1+x2)−1+\ C(1 + x^2)^{-1}⁠.)

Check it with numbers

Take C=1C = 1 and x=1x = 1⁠: log⁡sin⁡1≈−0.1726037\log\sin 1 \approx -0.1726037⁠, so y=−0.1726037+12≈0.4136981y = \frac{-0.1726037 + 1}{2} \approx 0.4136981⁠. With cot⁡1≈0.6420926\cot 1 \approx 0.6420926⁠, the equation says dydx=cot⁡x−2xy1+x2≈−0.0926518\frac{dy}{dx} = \frac{\cot x - 2xy}{1 + x^2} \approx -0.0926518⁠.

The curve itself: y(1.001)≈0.4136050084y(1.001) \approx 0.4136050084 and y(0.999)≈0.4137903108y(0.999) \approx 0.4137903108⁠, so

0.4136050084−0.41379031080.002≈−0.09265.\begin{aligned} &\frac{0.4136050084 - 0.4137903108}{0.002} \\ &\approx -0.09265. \end{aligned}
Common mistakes
  1. Reading P=2xyP = 2xy or forgetting to divide by 1+x21 + x^2⁠; P=2x1+x2P = \frac{2x}{1 + x^2} has no yy in it.
  2. Writing ∫cot⁡x dx=log⁡∣cos⁡x∣\int\cot x\,dx = \log|\cos x|; it is log⁡∣sin⁡x∣\log|\sin x|⁠.
  3. Dividing only the log term by 1+x21 + x^2: the constant becomes C(1+x2)−1C(1 + x^2)^{-1}⁠.
  4. Copying the key's (1+x)−1(1 + x)^{-1}: the factor is (1+x2)−1(1 + x^2)^{-1} in both terms.
What to take away
  1. P=f′(x)f(x)P = \frac{f'(x)}{f(x)} gives the I.F. ∣f(x)∣|f(x)|⁠; here f=1+x2>0f = 1 + x^2 > 0⁠.
  2. If the left side is already d[y⋅g(x)]d\big[y\cdot g(x)\big]⁠, you can integrate at once.
  3. State the condition the equation really needs: cot⁡x\cot x needs sin⁡x≠0\sin x \ne 0⁠.

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)
∫2x1+x2 dx=log⁡(1+x2)\int\frac{2x}{1 + x^2}\,dx = \log(1 + x^2) by substitution; elog⁡t=te^{\log t} = tStep 3Section 7.3.1; Chapter 5, Section 5.4 (Basics)
Product ruleSteps 4, 6Chapter 5, Section 5.3 (Basics)
∫cot⁡x dx=log⁡∣sin⁡x∣+C\int\cot x\,dx = \log|\sin x| + CStep 4Section 7.3.1 (Basics)
Substituting back into the equationSteps 6, 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 →