Curious Cheetah

Double u Substitution: ∫tan³θ dθ


\(u\) substitution is an important technique in integration. In the problem explored in this article, we look at a moderately advanced example in which \(u\) substitution is performed twice; it also involves trigonometric and logarithmic functions, as well as several other key issues in integration.


\[\tag{1}\int \tan^3\theta\,d\theta\]

Background Information

In order to complete this problem, we need two related pieces of information: \[\begin{align} \tag{2a} d(\tan \theta) = \frac{1}{\cos^2 \theta}\,d\theta \\ \tag{2b} \cos^2 \theta = \frac{1}{1+\tan^2 \theta} \end{align} \]
Note that (2a) is a rephrasing of the standard formula \(d(\tan \theta) = \sec^2 \theta\,d\theta\). The calculus texts with which Iʼm familiar tend to simply present that and the formulae for \(d(\cot \theta)\), \(d(\sec \theta)\), \(d(\csc \theta)\) as formulae to memorize. However, itʼs important that students do actually work these out; indeed, the derivatives of all six of the main trigonometric functions are based on the simple pair: \(d(\sin \theta) = \cos \theta\,d\theta; d(\cos \theta) = -\sin \theta\,d\theta\). Memorize that pair, and everything else can be generated as needed.
In this case, we need \(d(\tan \theta)\). This is derived as follows:
\[\begin{align} \tag{3a} d(\tan \theta) &= d\left(\frac{\sin \theta}{\cos \theta}\right)\\ \tag{3b} &= \frac{\cos \theta\cdot d(\sin \theta) - \sin \theta\cdot d(\cos \theta)}{\cos^2 \theta}\\ \tag{3c} &= \frac{\cos \theta\cdot\cos \theta\,d\theta - \sin \theta\cdot(-\sin \theta\,d\theta)}{\cos^2\theta}\\ \tag{3d} &= \frac{\cos^2 \theta + \sin^2 \theta}{\cos^2 \theta}\, d\theta \\ \tag{3e} &= \frac{1}{\cos^2 \theta}\, d\theta \end{align}\]
(3b) follows from the Quotient Rule:\[ \tag{4} d\left(\frac{f(x)}{g(x)}\right) = \frac{g(x)\cdot f'(x) - f(x)\cdot g'(x)}{g(x)^2}\]
(3e) follows from the Pythagoran Theorem. Since \(\sin \theta = \frac{a}{c}\) and \(\cos \theta = \frac{b}{c}\) (where \( a, b, c \) are the sides of a right triangle), we can calculate:
\[\begin{align} \tag{5a} \sin^2 \theta + \cos^2 \theta &= \frac{a^2}{c^2} + \frac{b^2}{c^2} \\ \tag{5b} &= \frac{a^2 + b^2}{c^2} \\ \tag{5c} &= \frac{c^2}{c^2} \\ \tag{5d} &= 1 &c \not= 0 \end{align}\]
Hence the important identity: \[ \tag{6} \sin^2 \theta + \cos^2 \theta = 1\]
(2b) can be demonstrated as follows: \[\begin{align} \tag{7a} \tan\theta &= \frac{\sin\theta}{\cos\theta} \\ \tag{7b} \tan^2 \theta &= \frac{\sin^2 \theta}{\cos^2 \theta} & a=\frac{b}{c} &\Rightarrow a^2=\frac{b^2}{c^2} \\ \tag{7c} 1 + \tan^2 \theta &= \frac{\sin^2 \theta}{\cos^2 \theta} + 1 \\ \tag{7d} &= \frac{\sin^2 \theta}{\cos^2 \theta} + \frac{\cos^2 \theta}{\cos^2 \theta} & \cos\theta=0 &\Rightarrow \theta=\pm90^\circ \\ \tag{7e} &= \frac{\sin^2 \theta + \cos^2 \theta}{\cos^2 \theta} \\ \tag{7f} &= \frac{1}{\cos^2 \theta} \\ \tag{7g} \cos^2 \theta &= \frac{1}{1 + \tan^2 \theta} \end{align} \]


For the first \(u\) substitution, we have three obvious candidates: \(\tan\theta\), \(\tan^2\theta\), and \(\tan^3\theta\). Letʼs use the first one: \[\begin{align} \tag{8a} u &= \tan\theta \\ \tag{8b} du &= \frac{d\theta}{\cos^2\theta} \\ \tag{8c} d\theta &= \cos^2\theta \,du \\ \tag{8d} &= \frac{du}{1 + \tan^2\theta} \end{align}\]
Substituting \(du\) and then \(u\) gives us: \[\begin{align} \tag{9a} \int\tan^3\theta\,d\theta &= \int\frac{\tan^3\theta}{1 + \tan^2\theta}\,du & \text{(8d)} \\ \tag{9b} &= \int\frac{u^3}{1+u^2}\,du & \text{(8a)} \end{align}\]
We canʼt perform this integration as is, so we have to do another substitution. Letʼs call the second new variable \(v\). There are several possible substitutions we could try, but letʼs use the denominator: \[\begin{align} \tag{10a} v &= 1+u^2 \\ \tag{10b} dv &= 2u\,du \\ \tag{10c} du &= \frac{dv}{2u} \end{align} \]
We substitute \(dv\) and then \(v\), and then simplify: \[\begin{align} \tag{11a} \int \frac{u^3}{1+u^2}\,du &= \int \frac{u^3}{(1+u^2) \cdot 2u}\,dv & \text{(10c)} \\ \tag{11b} &= \int \frac{u^2}{(1+u^2) \cdot 2}\,dv \\ \tag{11c} &= \int \frac{(1+u^2)-1}{2\cdot (1+u^2)}\,dv \\ \tag{11d} &= \int \frac{v - 1}{2v}\,dv & \text{(10a)} \\ \tag{11e} &= \frac{1}{2} \left(\int \frac{v}{v}\,dv - \int \frac{1}{v}\,dv\right) \\ \tag{11f} &= \frac{1}{2} \left(\int 1\,dv - \int \frac{1}{v}\,dv\right) \end{align} \]
At this point, we can easily integrate (11e): \[\tag{12} \frac{1}{2} \left(\int 1\,dv - \int \frac{1}{v}\,dv = \frac{v}{2} - \frac{\ln v}{2}\right) + c\]
and then reverse the substitutions: \[\begin{align} \tag{12a} \frac{1}{2} \left(\int 1\,dv - \int \frac{1}{v}\,dv \right) &= \frac{1}{2}(v - \ln v) + c \\ \tag{12b} &= \frac{v}{2} - \frac{\ln v}{2} + c \end{align} \]
(7f) (that is, the inverse of (2b)) then gives us: \[\begin{align} \tag{14a} \frac{1 + \tan^2 \theta}{2} - \frac{\ln(1 + \tan^2\theta)}{2} + c &= \frac{1}{2\cdot\cos^2\theta} - \frac{1}{2}\ln\left(\frac{1}{\cos^2\theta}\right) + c \\ \tag{14b} &= \frac{\sec^2\theta}{2} + \ln((\cos^{-2}\theta)^{-\frac{1}{2}}) + c \\ \tag{14c} &= \frac{\sec^2\theta}{2} + \ln(\cos\theta) + c \end{align}\]
The second term in (14b) is the result of applying the following property of logarithms: \(a\cdot\log_n c = \log_n c^a\). Meanwhile, (14c) results from the application of this property of exponents: \((x^a)^b = x^{(a\cdot b)}\).
This gives us our final answer (confirmed by Wolfram Alpha):
\[\tag{15}\boxed{\int \tan^3\theta\,d\theta = \frac{\sec^2\theta}{2} + \ln(\cos\theta) + c}\]