Evaluate $\int\sec^2(x)\tan(x)\,\mathrm dx$
I know we can use $\text{substitution}$, but I instinctively used Integration By Parts and am not getting the right answer. What am I missing? 
Evaluate $\int\sec^2(x)\tan(x)\,\mathrm dx$
I know we can use $\text{substitution}$, but I instinctively used Integration By Parts and am not getting the right answer. What am I missing? 
$\frac {\tan^2 \theta} 2 + C$ is not incorrect! Try differentiating it again, you'll get the same thing.
We have $1 + \tan^2 \theta = \sec^2 \theta$ (divide the identity $\sin^2 \theta + \cos^2 \theta = 1$ by $\cos^2 \theta$ if you haven't seen this before) so we could write:
$$\frac {\tan^2 \theta} 2 + C = \frac {\sec^2 \theta} 2 + C - \frac 1 2$$
and writing a new arbitrary constant $C' = C - \frac 1 2$ gives you the cleaner:
$$\int \sec^2 \theta \tan \theta d\theta =\frac {\tan^2 \theta} 2 + C = \frac {\sec^2 \theta} 2 + C'$$
This is a quirk of "indefinite" integration, you are not just looking at one function, but a family of functions that all differ by a constant. You are free to shift this constant without really changing anything, because the constant will always just differentiate away to zero. Formally speaking we are saying that the set of functions $\{f_C(\theta) =\sec^2 \theta + C : C \in \mathbb R\}$ is equal to the set of functions $\{g_C(\theta) = \tan^2 \theta + C : C \in \mathbb R\}$.