Can an indefinite integral have multiple answers? (Besides the ' + C') [duplicate]
In your case, the difference between the two is a constant:
$$\sin^2 x + \cos^2 x = 1$$
so
$$\tan^2 x + 1 = \sec^2 x$$
In general, that will be true as well - integration can only be different up to a constant: consider $g = \int f = h$ and note that $g-h = \int f - \int f = \int 0 = const$.
They wouldn't give different answers in a definite integral. Suppose that we want to find $\displaystyle\int_a^b f(x)\,dx$. Let $F(x)$ be one antiderivative of $f(x)$, and let $G(x)$ be another. They differ by a constant, so $G(x)=F(x)+C$ for some constant $C$.
If you use $F(x)$ to evaluate the integral from $a$ to $b$, you get $F(b)-F(a)$.
If you use $G(x)$, you get $G(b)-G(a)$, that is, $(F(b)+C)-(F(a)+C)$. Simplify. The $C$'s cancel.