$\displaystyle \int sec^2xtanxdx$

I let u=tanx

du=sec^2xdx

$\displaystyle \int udu$

$\displaystyle \frac{u^2}{2} + C$

$\displaystyle \frac{1}{2}tan^2x + C$

The answer key let u=sec^2x

Their answer is

$\displaystyle \frac{1}{2}sec^2x + C$

It doesn't seem that they could be the same. What did I do wrong?