$\int{(\sec^4{x})}dx = \cdots$

I'm doing integration by substitution,

I've been asked to integrate $\int{\sec^4 x}dx$ using $u = \tan{x}$. I did: $$\frac{du}{dx} = \sec^2{x} \Rightarrow dx = \frac{du}{\sec^2{x}}\\.$$ Thus, \begin{align} \int{(sec^4{x})} dx& = \int{\left(\frac{sec^4{x}}{\sec^2{x}}\right)} du\\ & = \int{(\sec^2{x})}du\\ &=\int{(1+\tan^2{x})}du\\ &= \int{(1+u^2)}du\\ & = u + \frac{u^3}{3}+c\\ &= \tan{x} + \frac{\tan^3{x}}{3}+C. \end{align} However, the answer is actually: $$\frac{\cos^3{x}}{3}-\cos{x}+c$$

It seems I'm close but have made a mistake, I don't understand.

• Your answer is right, the book has a typo. – DeepSea Dec 14 '16 at 2:09
• Wow, what a waste of time... – Tobi Dec 14 '16 at 2:14

As pointed out, the solution in the book is wrong. I've had this happen to me before and it's really frustrating. When I was in integral calculus and I suspected this was happening this is how I would check. If you differentiate the answer they give you get: $$\frac{d}{dx}(\frac{\cos^3(x)}{3}-\cos(x)+C)=-\sin(x) \cos^2(x)+\sin(x).$$ Using $\cos^2(x)=\sin^2(x)-1$ we have, $$-\sin(x)(1-\sin^2(x))+\sin(x)=\sin^3(x).$$ At this point you can be sure that $\sin^3(x)$ does not equal $\sec^4(x)$. Since differentiation undoes integration you can be sure at this point their answer is wrong.