Skip to content

Mathematics · Ch 10 — Indefinite Integration

Integrals of tan x, cot x, sec x and cosec x

10.2.2

Integrals of tan x, cot x, sec x and cosec x

Corollary III of section 3.2.1 (∫f′(x)f(x)dx=log⁡∣f(x)∣+c\int\frac{f'(x)}{f(x)}dx=\log|f(x)|+c) immediately settles the integrals of tan⁡x\tan x, cot⁡x\cot x, sec⁡x\sec x and csc⁡x\csc x.

∫tan⁡x dx\int\tan x\,dx. ∫sin⁡xcos⁡x dx=−∫−sin⁡xcos⁡x dx=−log⁡∣cos⁡x∣+c=log⁡∣sec⁡x∣+c\int\frac{\sin x}{\cos x}\,dx=-\int\frac{-\sin x}{\cos x}\,dx=-\log|\cos x|+c=\log|\sec x|+c (since ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x=-\sin x).

∫cot⁡(5x−4) dx\int\cot(5x-4)\,dx. ∫5cos⁡(5x−4)5sin⁡(5x−4) dx=15log⁡∣sin⁡(5x−4)∣+c\int\frac{5\cos(5x-4)}{5\sin(5x-4)}\,dx=\frac15\log|\sin(5x-4)|+c (Corollary I applied to the basic cot⁡\cot result).

∫sec⁡x dx\int\sec x\,dx. Multiply and divide by (sec⁡x+tan⁡x)(\sec x+\tan x): ∫sec⁡2x+sec⁡xtan⁡xsec⁡x+tan⁡x dx\int\frac{\sec^2x+\sec x\tan x}{\sec x+\tan x}\,dx. Since ddx(sec⁡x+tan⁡x)=sec⁡xtan⁡x+sec⁡2x\frac{d}{dx}(\sec x+\tan x)=\sec x\tan x+\sec^2x exactly matches the numerator, this is log⁡∣sec⁡x+tan⁡x∣+c\log|\sec x+\tan x|+c, which also equals log⁡∣tan⁡(x2+π4)∣+c\log\left|\tan\left(\frac x2+\frac\pi4\right)\right|+c.

∫csc⁡x dx\int\csc x\,dx. By the parallel trick, multiplying and dividing by (csc⁡x−cot⁡x)(\csc x-\cot x), ∫csc⁡x dx=log⁡∣csc⁡x−cot⁡x∣+c=log⁡∣tan⁡x2∣+c\int\csc x\,dx=\log|\csc x-\cot x|+c=\log\left|\tan\frac x2\right|+c.

The same "numerator is the derivative of the denominator" idea, or "power of f(x)f(x) times f′(x)f'(x)", extends to many exponential, logarithmic and trigonometric integrands built from a hidden substitution:

∫cot⁡(log⁡x)x dx\int\dfrac{\cot(\log x)}{x}\,dx. Put log⁡x=t\log x=t, so 1x dx=dt\frac1x\,dx=dt; the integral becomes ∫cot⁡t dt=log⁡∣sin⁡t∣+c=log⁡∣sin⁡(log⁡x)∣+c\int\cot t\,dt=\log|\sin t|+c=\log|\sin(\log x)|+c.

∫cos⁡xx dx\int\dfrac{\cos\sqrt x}{\sqrt x}\,dx. Put x=t\sqrt x=t, so 12x dx=dt\frac{1}{2\sqrt x}\,dx=dt, i.e. 1x dx=2 dt\frac{1}{\sqrt x}\,dx=2\,dt; the integral becomes 2∫cos⁡t dt=2sin⁡t+c=2sin⁡x+c2\int\cos t\,dt=2\sin t+c=2\sin\sqrt x+c.

∫sec⁡8xcsc⁡x dx\int\dfrac{\sec^8x}{\csc x}\,dx. Rewrite as sec⁡7x⋅sec⁡x⋅1csc⁡x=sec⁡7x⋅sec⁡xtan⁡x\sec^7x\cdot\sec x\cdot\frac{1}{\csc x}=\sec^7x\cdot\sec x\tan x (using 1csc⁡x=sin⁡x=cos⁡xtan⁡x\frac1{\csc x}=\sin x=\cos x\tan x, and grouping sec⁡x⋅cos⁡xtan⁡x=tan⁡x\sec x\cdot\cos x\tan x=\tan x, then sec⁡7x⋅tan⁡x=sec⁡6x⋅sec⁡xtan⁡x\sec^7x\cdot\tan x = \sec^6x\cdot\sec x\tan x). Put sec⁡x=t\sec x=t, sec⁡xtan⁡x dx=dt\sec x\tan x\,dx=dt: integral becomes ∫t6 dt=t77+c=sec⁡7x7+c\int t^6\,dt=\frac{t^7}7+c=\frac{\sec^7x}7+c.

∫1x+x dx\int\dfrac{1}{x+\sqrt x}\,dx. Factor the denominator as x(x+1)\sqrt x(\sqrt x+1). Put x+1=t\sqrt x+1=t, so 12xdx=dt\frac{1}{2\sqrt x}dx=dt, i.e. 1xdx=2 dt\frac{1}{\sqrt x}dx=2\,dt: integral becomes 2∫1t dt=2log⁡∣t∣+c=2log⁡(x+1)+c2\int\frac1t\,dt=2\log|t|+c=2\log(\sqrt x+1)+c.

∫55x⋅5x dx\int5^{5x}\cdot5^x\,dx. Put 5x=t5^x=t, so 5xlog⁡5 dx=dt5^x\log5\,dx=dt; the integrand 55x⋅5x=t5⋅t=t65^{5x}\cdot5^x=t^5\cdot t=t^6... more precisely rewriting via tt: the integral becomes 1log⁡5∫5t dt=1log⁡5⋅5tlog⁡5+c=1(log⁡5)2⋅55x+c\frac{1}{\log5}\int5^t\,dt=\frac{1}{\log5}\cdot\frac{5^t}{\log5}+c=\frac{1}{(\log5)^2}\cdot5^{5x}+c.

∫11+e−x dx\int\dfrac{1}{1+e^{-x}}\,dx. Multiply top and bottom by exe^x: ∫exex+1 dx=log⁡(ex+1)+c\int\dfrac{e^x}{e^x+1}\,dx=\log(e^x+1)+c, since the numerator is exactly the derivative of the denominator.

∫ex⋅1+xcos⁡(xex) dx\int e^x\cdot\dfrac{1+x}{\cos(xe^x)}\,dx. Put xex=txe^x=t; differentiating, (xex+ex) dx=ex(1+x) dx=dt(xe^x+e^x)\,dx=e^x(1+x)\,dx=dt. The integral becomes ∫sec⁡t dt=log⁡∣sec⁡t+tan⁡t∣+c=log⁡[sec⁡(xex)+tan⁡(xex)]+c\int\sec t\,dt=\log|\sec t+\tan t|+c=\log\left[\sec(xe^x)+\tan(xe^x)\right]+c.

∫13x+7x−n dx\int\dfrac{1}{3^x+7x^{-n}}\,dx. Rewrite the denominator as 3xn+1+7xn\dfrac{3x^{n+1}+7}{x^n}, so the integral is ∫xn3xn+1+7 dx\int\dfrac{x^n}{3x^{n+1}+7}\,dx. Put 3xn+1+7=t3x^{n+1}+7=t, so 3(n+1)xn dx=dt3(n+1)x^n\,dx=dt: the integral becomes 13(n+1)log⁡∣3xn+1+7∣+c\dfrac{1}{3(n+1)}\log|3x^{n+1}+7|+c.

∫(3x+2)x−4 dx\int(3x+2)\sqrt{x-4}\,dx. Put x−4=tx-4=t, so x=4+tx=4+t, dx=dtdx=dt: integral becomes ∫(14+3t)t dt=∫(14t1/2+3t3/2)dt=283(x−4)3/2+65(x−4)5/2+c\int(14+3t)\sqrt t\,dt=\int\left(14t^{1/2}+3t^{3/2}\right)dt=\dfrac{28}{3}(x-4)^{3/2}+\dfrac{6}{5}(x-4)^{5/2}+c.

∫sin⁡(x+a)cos⁡(x−b) dx\int\dfrac{\sin(x+a)}{\cos(x-b)}\,dx. Write x+a=(x−b)+(a+b)x+a=(x-b)+(a+b) and expand sin⁡[(x−b)+(a+b)]\sin[(x-b)+(a+b)] by the addition formula, then divide by cos⁡(x−b)\cos(x-b): the integrand becomes cos⁡(a+b)tan⁡(x−b)+sin⁡(a+b)\cos(a+b)\tan(x-b)+\sin(a+b), so the integral is cos⁡(a+b)log⁡∣sec⁡(x−b)∣+xsin⁡(a+b)+c\cos(a+b)\log|\sec(x-b)|+x\sin(a+b)+c.

∫ex+1ex−1 dx\int\dfrac{e^x+1}{e^x-1}\,dx. Write the numerator as (ex−1)+2(e^x-1)+2: integral becomes ∫1 dx+2∫1ex−1 dx=x+2∫e−x1−e−x dx\int1\,dx+2\int\dfrac{1}{e^x-1}\,dx=x+2\int\dfrac{e^{-x}}{1-e^{-x}}\,dx; putting 1−e−x=t1-e^{-x}=t (so e−x dx=dte^{-x}\,dx=dt) gives x+2log⁡(1−e−x)+cx+2\log(1-e^{-x})+c. …