I tried to find a generic antiderivative for
$$\displaystyle \int \sec^2x \tan x \mathop{dx} $$
but I think there is something wrong with my solution because it doesn't match what I got through an online calculator.
What am I doing wrong?
Below is my solution.
We will use substitution:
$$u = \sec x \qquad du = \sec x \tan x \, dx$$
We substitute and apply the power rule:
$$ \int (\sec x) (\sec x \tan x \, dx) = \int u \, du = \frac{1}{2} u^2 + C = \frac{\sec^2x}{2} + C$$
The solution I found with the online calculator is:
$$ \frac{\tan ^2 x}{2} + C$$
The steps in the online solution make sense also, so I'm not sure what's going on.
The one thing I have some doubts about is whether I derived the $du$ from $u = \sec x$ correctly. But it seems okay to me. I used implicit differentiation with $x$.
$$\frac{\sec^{2}(x)}{2} + C = \frac{1+\tan^{2}(x)}{2} + C = \frac{1}{2} + \frac{\tan^{2}(x)}{2} + C$$
$\frac{1}{2}$ is just another constant, in indefinite integral constant doesn't really matter unless you're asked for the integrand original function so you can just kind of "combine" $\frac{1}{2}$ into C, you can also differentiate the answer to know that there's nothing wrong at all with your answer