Answer
(a) $\int \tan x \sec ^{2} x d x=\frac{\tan ^{2} x}{2}+C^{\prime}$
(b)
One solution can be expressed as the other. Thus, both solutions are correct.
Work Step by Step
(a) The given:
\[
\int \tan x \sec ^{2} x d x
\]
Let us consider
\[
\sec x=u
\]
$\Longrightarrow d u=\tan x \sec x d x \quad$
Putting this value in the given integral, we have
\[
\begin{aligned}
\int \tan x \sec ^{2} x d x &=\int \sec x[\tan x \sec x d x] \\
&=\int u d u \\
&=\frac{u^{2}}{2}+C \\
&=\frac{\sec ^{2} x}{2}+C
\end{aligned}
\]
Again let us consider
\[
u=\tan x
\]
Putting this value in the given integral, we get
$\Longrightarrow d u=\sec ^{2} x d x \quad,$
\[
\begin{aligned}
\int \sec ^{2} x \tan x d x &=\int u d u \\
&=\frac{u^{2}}{2}+C^{\prime} \\
&=\frac{\tan ^{2} x}{2}+C^{\prime}
\end{aligned}
\]
Thus we can say that different substitutes produce different solutions for a given integral
(b) We can see
\[
\begin{aligned}
\int \sec ^{2} x \tan x d x &=\frac{\sec ^{2} x}{2}+C \\
&=\frac{1}{2}\left(1+\tan ^{2} x\right)+C \\
&=\frac{\tan ^{2} x}{2}+\left(\frac{1}{2}+C\right) \\
&=\frac{\tan ^{2} x}{2}+C^{\prime \prime} \quad \text { let } C+\frac{1}{2}=C^{\prime \prime}
\end{aligned}
\]
One solution can be expressed as the other. Thus, both solutions are correct.