Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 39: ∫(cot⁡x+tan⁡x)dx\int\left(\sqrt{\cot x}+\sqrt{\tan x}\right)dx

ExamplesSubstitution and special integrals · Miscellaneous Examples
The question

Find

∫[cot⁡x+tan⁡x ]dx\int\left[\sqrt{\cot x} + \sqrt{\tan x}\,\right]dx
Exam answer

Let I=∫(cot⁡x+tan⁡x)dxI = \displaystyle\int\left(\sqrt{\cot x} + \sqrt{\tan x}\right)dx⁠.

Since cot⁡x=tan⁡x⋅cot⁡x\sqrt{\cot x} = \sqrt{\tan x}\cdot\cot x⁠,

I=∫tan⁡x (1+cot⁡x) dxI = \int\sqrt{\tan x}\,(1 + \cot x)\,dx

Put tan⁡x=t2\tan x = t^2⁠. Then sec⁡2x dx=2t dt\sec^2 x\,dx = 2t\,dt⁠, so dx=2t dt1+t4dx = \frac{2t\,dt}{1 + t^4}⁠.

I=∫t(1+1t2)2t dt1+t4=2∫t2+1t4+1 dt\begin{aligned} I &= \int t\left(1 + \frac{1}{t^2}\right)\frac{2t\,dt}{1 + t^4} \\ &= 2\int\frac{t^2 + 1}{t^4 + 1}\,dt \end{aligned}

Dividing numerator and denominator by t2t^2⁠,

I=2∫1+1t2t2+1t2 dt=2∫1+1t2(t−1t)2+2 dt\begin{aligned} I &= 2\int\frac{1 + \frac{1}{t^2}}{t^2 + \frac{1}{t^2}}\,dt \\ &= 2\int\frac{1 + \frac{1}{t^2}}{\left(t - \frac1t\right)^2 + 2}\,dt \end{aligned}

Put t−1t=yt - \frac1t = y⁠. Then (1+1t2)dt=dy\left(1 + \frac{1}{t^2}\right)dt = dy⁠.

I=2∫dyy2+(2)2I = 2\int\frac{dy}{y^2 + \left(\sqrt2\right)^2}

Using ∫dyy2+a2=1atan⁡−1ya+C\displaystyle\int\frac{dy}{y^2 + a^2} = \frac1a\tan^{-1}\frac{y}{a} + C⁠,

I=22tan⁡−1y2+C=2tan⁡−1(t2−12 t)+C\begin{aligned} I &= \frac{2}{\sqrt2}\tan^{-1}\frac{y}{\sqrt2} + C \\ &= \sqrt2\tan^{-1}\left(\frac{t^2 - 1}{\sqrt2\,t}\right) + C \end{aligned}

∴ I=2tan⁡−1(tan⁡x−12tan⁡x)+C\therefore\ I = \sqrt2\tan^{-1}\left(\dfrac{\tan x - 1}{\sqrt{2\tan x}}\right) + C⁠.

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

The one idea this problem is built on

Two substitutions in a row. First tan⁡x=t2\tan x = t^2 removes the square roots and turns the integral into one of a rational function, ∫2(t2+1)t4+1 dt\int\frac{2(t^2+1)}{t^4+1}\,dt⁠. Then dividing top and bottom by t2t^2 shows the numerator 1+1t21 + \frac{1}{t^2} is the derivative of t−1tt - \frac1t⁠, while the denominator t2+1t2t^2 + \frac{1}{t^2} equals (t−1t)2+2\left(t - \frac1t\right)^2 + 2⁠. So y=t−1ty = t - \frac1t gives the standard form ∫dyy2+a2\int\frac{dy}{y^2 + a^2}⁠.

Given, to find, and the plan
Given
The integrand cot⁡x+tan⁡x\sqrt{\cot x} + \sqrt{\tan x}⁠.
To find
Its indefinite integral, and where it is valid.
Plan
(1) Domain: tan⁡x>0\tan x > 0⁠. (2) Write the integrand as t+1tt + \frac1t with t=tan⁡xt = \sqrt{\tan x}⁠. (3) Substitute tan⁡x=t2\tan x = t^2⁠. (4) Divide by t2t^2⁠, complete the square. (5) Substitute y=t−1ty = t - \frac1t⁠. (6) Back to xx⁠. (7) Check.

Basics you need

1Substitution (Section 7.3.1)

Change the variable, express dxdx through the new differential, and make sure no old variable is left. Basics: substitution

2sec⁡2x=1+tan⁡2x\sec^2 x = 1 + \tan^2 x

and ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x⁠. Basics: trigonometric identities

3Section 7.4, formula (3)

∫dyy2+a2=1atan⁡−1ya+C\int\frac{dy}{y^2 + a^2} = \frac1a\tan^{-1}\frac{y}{a} + C (a>0a > 0⁠). Lesson: integrals of particular functions

4A square in disguise

(t−1t)2=t2−2+1t2\left(t - \frac1t\right)^2 = t^2 - 2 + \frac{1}{t^2}⁠, so t2+1t2=(t−1t)2+2t^2 + \frac{1}{t^2} = \left(t - \frac1t\right)^2 + 2⁠. Basics: completing the square

Solution

  1. Where is the integrand defined?

    tan⁡x\sqrt{\tan x} needs tan⁡x≥0\tan x \ge 0⁠, and cot⁡x\sqrt{\cot x} needs cot⁡x=1tan⁡x\cot x = \frac{1}{\tan x} to exist and be ≥0\ge 0⁠, so tan⁡x≠0\tan x \ne 0⁠. Together: tan⁡x>0\tan x > 0⁠, which happens exactly on the intervals

    kπ<x<kπ+π2,k∈Z.k\pi < x < k\pi + \frac{\pi}{2}, \qquad k \in \Z .

    We work on one such interval, say 0<x<π20 < x < \frac{\pi}{2}⁠; everything below is the same on the others, since tan⁡\tan and cot⁡\cot have period π\pi⁠.

    Square roots of negative numbers are not real, and cot⁡x\cot x is undefined where tan⁡x=0\tan x = 0⁠. On each interval the integrand is continuous, so it has an antiderivative there.
    tan⁡x>0\tan x > 0 in the first and third quadrants.
  2. Rewrite with tan⁡x\sqrt{\tan x} only

    Since cot⁡x=1tan⁡x\cot x = \frac{1}{\tan x} and tan⁡x>0\tan x > 0⁠, cot⁡x=1tan⁡x\sqrt{\cot x} = \frac{1}{\sqrt{\tan x}}⁠. So

    cot⁡x+tan⁡x=tan⁡x (cot⁡x+1)=tan⁡x+1tan⁡x.\sqrt{\cot x} + \sqrt{\tan x} = \sqrt{\tan x}\,(\cot x + 1) = \sqrt{\tan x} + \frac{1}{\sqrt{\tan x}} .
    The textbook writes tan⁡x (1+cot⁡x)\sqrt{\tan x}\,(1 + \cot x)⁠; the last form is the same thing, and it shows that with t=tan⁡xt = \sqrt{\tan x} the integrand is simply t+1tt + \frac1t⁠.
    tan⁡x⋅cot⁡x=tan⁡xtan⁡x=1tan⁡x\sqrt{\tan x}\cdot\cot x = \frac{\sqrt{\tan x}}{\tan x} = \frac{1}{\sqrt{\tan x}}⁠.
  3. Substitute tan⁡x=t2\tan x = t^2 (with t=tan⁡x>0t = \sqrt{\tan x} > 0⁠)

    Differentiate both sides of tan⁡x=t2\tan x = t^2⁠: sec⁡2x dx=2t dt\sec^2 x\,dx = 2t\,dt⁠. Since sec⁡2x=1+tan⁡2x=1+t4\sec^2 x = 1 + \tan^2 x = 1 + t^4⁠,

    dx=2t dt1+t4.dx = \frac{2t\,dt}{1 + t^4} .

    So

    I=∫(t+1t)2t1+t4 dt=∫2t2+2t4+1 dt=2∫t2+1t4+1 dt.\begin{aligned}I &= \int\left(t + \frac1t\right)\frac{2t}{1+t^4}\,dt\\ &= \int\frac{2t^2 + 2}{t^4 + 1}\,dt = 2\int\frac{t^2+1}{t^4+1}\,dt .\end{aligned}
    The substitution clears both square roots at once. It is legitimate: on 0<x<π20 < x < \frac{\pi}{2}⁠, t=tan⁡xt = \sqrt{\tan x} is a differentiable, increasing function taking every value in (0,∞)(0, \infty)⁠. The result is a rational function of tt⁠, which we know how to attack.
    (t+1t)⋅2t=2t2+2\left(t + \frac1t\right)\cdot 2t = 2t^2 + 2⁠. Lesson: integration by substitution
  4. Divide top and bottom by t2t^2

    Since t>0t > 0⁠, we may divide numerator and denominator by t2t^2⁠:

    I=2∫1+1t2t2+1t2 dt=2∫1+1t2(t−1t)2+2 dt.I = 2\int\frac{1 + \frac{1}{t^2}}{t^2 + \frac{1}{t^2}}\,dt = 2\int\frac{1 + \frac{1}{t^2}}{\left(t - \frac1t\right)^2 + 2}\,dt .
    This is the clever step. The numerator 1+1t21 + \frac{1}{t^2} is exactly the derivative of t−1tt - \frac1t⁠, so if the denominator can be written using t−1tt - \frac1t too, a substitution will finish the job. Basic 4 shows it can: t2+1t2=(t−1t)2+2t^2 + \frac{1}{t^2} = \left(t - \frac1t\right)^2 + 2⁠.
  5. Substitute y=t−1ty = t - \frac1t

    Then dy=(1+1t2)dtdy = \left(1 + \frac{1}{t^2}\right)dt⁠, and

    I=2∫dyy2+(2)2=2⋅12tan⁡−1y2+C=2tan⁡−1y2+C.\begin{aligned}I &= 2\int\frac{dy}{y^2 + (\sqrt2)^2} = 2\cdot\frac{1}{\sqrt2}\tan^{-1}\frac{y}{\sqrt2} + C\\ &= \sqrt2\tan^{-1}\frac{y}{\sqrt2} + C .\end{aligned}
    Section 7.4, formula (3) with a=2a = \sqrt2⁠. As tt runs over (0,∞)(0, \infty)⁠, y=t−1ty = t - \frac1t increases from −∞-\infty to ∞\infty⁠, so this is a valid one-to-one substitution. Also 2⋅12=22\cdot\frac{1}{\sqrt2} = \sqrt2⁠.
    ddt(−1t)=1t2\frac{d}{dt}\left(-\frac1t\right) = \frac{1}{t^2}⁠.
  6. Back to xx

    y2=t−1t2=t2−12 t\frac{y}{\sqrt2} = \frac{t - \frac1t}{\sqrt2} = \frac{t^2 - 1}{\sqrt2\,t}⁠, and with t2=tan⁡xt^2 = \tan x⁠, t=tan⁡xt = \sqrt{\tan x}⁠:

    I=2tan⁡−1(tan⁡x−12tan⁡x)+C.I = \sqrt2\tan^{-1}\left(\frac{\tan x - 1}{\sqrt{2\tan x}}\right) + C .
    Multiplying top and bottom of t−1/t2\frac{t - 1/t}{\sqrt2} by tt clears the inner fraction. Then 2 t=2tan⁡x=2tan⁡x\sqrt2\,t = \sqrt2\sqrt{\tan x} = \sqrt{2\tan x}⁠.
  7. Check: ddx\frac{d}{dx} of our answer

    Let G=2tan⁡−1uG = \sqrt2\tan^{-1}u with u=t2−12 tu = \frac{t^2 - 1}{\sqrt2\,t}⁠. First differentiate with respect to tt⁠. Here dudt=12(1+1t2)\frac{du}{dt} = \frac{1}{\sqrt2}\left(1 + \frac{1}{t^2}\right)⁠, which is t2+12 t2\frac{t^2+1}{\sqrt2\,t^2}⁠, and

    1+u2=1+(t2−1)22t2=t4+12t2.1 + u^2 = 1 + \frac{(t^2-1)^2}{2t^2} = \frac{t^4 + 1}{2t^2} .

    So

    dGdt=2⋅2t2t4+1⋅t2+12 t2=2(t2+1)t4+1.\frac{dG}{dt} = \sqrt2\cdot\frac{2t^2}{t^4+1}\cdot\frac{t^2+1}{\sqrt2\,t^2} = \frac{2(t^2+1)}{t^4+1} .

    Then, with dtdx=1+t42t\frac{dt}{dx} = \frac{1 + t^4}{2t} from Step 3,

    dGdx=2(t2+1)t4+1⋅t4+12t=t2+1t=t+1t,\frac{dG}{dx} = \frac{2(t^2+1)}{t^4+1}\cdot\frac{t^4+1}{2t} = \frac{t^2 + 1}{t} = t + \frac1t ,

    which is tan⁡x+1tan⁡x=tan⁡x+cot⁡x\sqrt{\tan x} + \frac{1}{\sqrt{\tan x}} = \sqrt{\tan x} + \sqrt{\cot x}⁠, the integrand.

    The chain rule through tt keeps the algebra short. ddutan⁡−1u=11+u2\frac{d}{du}\tan^{-1}u = \frac{1}{1+u^2}⁠, and (t2−1)2+2t2=t4+1(t^2 - 1)^2 + 2t^2 = t^4 + 1⁠.
Result

∫(cot⁡x+tan⁡x)dx=2tan⁡−1(tan⁡x−12tan⁡x)+C\begin{aligned}&\int\left(\sqrt{\cot x} + \sqrt{\tan x}\right)dx\\ &= \sqrt2\tan^{-1}\left(\frac{\tan x - 1}{\sqrt{2\tan x}}\right) + C\end{aligned} on each interval where tan⁡x>0\tan x > 0⁠. This is the textbook's answer.

Check it with numbers

At x=π4x = \frac{\pi}{4}⁠: the integrand is 1+1=21 + 1 = 2⁠, and a numerical derivative of the answer gives 2.0000002.000000⁠. At x=π6x = \frac{\pi}{6}⁠: integrand 31/4+3−1/4≈2.0759103^{1/4} + 3^{-1/4} \approx 2.075910⁠, numerical derivative 2.0759102.075910⁠. At x=π+0.5x = \pi + 0.5 (in the third quadrant): integrand ≈2.092078\approx 2.092078⁠, numerical derivative 2.0920782.092078⁠.

Common mistakes
  1. Writing dx=2t dtsec⁡2xdx = \frac{2t\,dt}{\sec^2 x} and stopping. sec⁡2x\sec^2 x must be rewritten in tt⁠: sec⁡2x=1+t4\sec^2 x = 1 + t^4⁠.
  2. Using t+1tt + \frac1t in the denominator. t2+1t2=(t+1t)2−2t^2 + \frac{1}{t^2} = \left(t + \frac1t\right)^2 - 2 is also true, but its derivative partner is 1−1t21 - \frac{1}{t^2}⁠, which is not our numerator.
  3. Dropping the factor 2. 2⋅12=22\cdot\frac{1}{\sqrt2} = \sqrt2 in front of tan⁡−1\tan^{-1}⁠.
What to take away
  1. ∫t2+1t4+1 dt\int\frac{t^2 + 1}{t^4 + 1}\,dt and ∫t2−1t4+1 dt\int\frac{t^2 - 1}{t^4 + 1}\,dt⁠: divide by t2t^2⁠, then use y=t−1ty = t - \frac1t or y=t+1ty = t + \frac1t to match the numerator.
  2. Square roots of tan⁡x\tan x are removed by tan⁡x=t2\tan x = t^2⁠, with sec⁡2x=1+t4\sec^2 x = 1 + t^4⁠.
  3. The same method gives the two separate integrals ∫tan⁡x dx\int\sqrt{\tan x}\,dx and ∫cot⁡x dx\int\sqrt{\cot x}\,dx⁠; their sum, asked here, is the easier one.

Every fact used, and where it comes from

FactUsed inSource
tan⁡x>0\tan x > 0 on (kπ,kπ+π2)(k\pi, k\pi + \frac{\pi}{2})Step 1Class XI trigonometry
ddxtan⁡x=sec⁡2x=1+tan⁡2x\frac{d}{dx}\tan x = \sec^2 x = 1 + \tan^2 xStep 3Chapter 5; Class XI identity
SubstitutionSteps 3, 5Section 7.3.1 (Lesson: substitution)
t2+1t2=(t−1t)2+2t^2 + \frac{1}{t^2} = \left(t - \frac1t\right)^2 + 2Step 4Algebra
∫dyy2+a2=1atan⁡−1ya+C\int\frac{dy}{y^2 + a^2} = \frac1a\tan^{-1}\frac{y}{a} + CStep 5Section 7.4, formula (3) (Lesson: particular functions)
ddutan⁡−1u=11+u2\frac{d}{du}\tan^{-1}u = \frac{1}{1+u^2}Step 7Chapter 5, Section 5.3.3
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 →