Question: Evaluate the Integral:$\displaystyle\int\sec(x)\,\mathrm dx $
Approach 1 :
Write $\sec(x)$ as $\ \frac{1}{\cos(x)}$,
$$\ \int \frac{1}{\cos(x)}\,\mathrm dx $$
Substitute $\sin^2(x) + \cos^2(x) $ for $1$,
$$\int \frac{\sin^2(x) + \cos^2(x)}{\cos(x)}\,\mathrm dx $$
Expand the fraction and simplify to get a linear integrand,
$$\int\tan(x)\sec(x)\,\mathrm dx + \int\cos(x)\,\mathrm dx $$
Evaluating the integrand using standard integrals,
$$\ (\sec(x)+c_1) + (\sin(x)+c_2)$$
Merging the constants and simplifying the integrals we get,
$$\sec(x) + \sin(x) + C $$
Approach 2 :
Multiplying and dividing by $\sec(x)+\tan(x)$ we get,
$$\int \frac{\sec(x)(\sec(x)+\tan(x))}{\sec(x)+\tan(x)}\,\mathrm dx $$
Let y=$\sec(x)+\tan(x)$ and finding its derivative,
$$\frac{\mathrm dy}{\mathrm dx} = \sec(x)\bigl(\sec(x)+\tan(x)\bigr) $$
$$\,\mathrm dx = \frac{\mathrm dy}{\sec(x)\bigl(\sec(x)+\tan(x)\bigr)} $$
Substituting $y$ and $\mathrm dy$,
$$\ \int \frac{\mathrm dy}y $$
Evaluating the integral,
$$\ln(|y|) $$
Substituting for $y$,
$$\ln\left(\bigl|\sec(x)+\tan(x)\bigr|\right) $$
The answers don't appear to be the same. My question is, since they are the results of the same integral the answers must be the same yet appear different how can this be proved to be the same?
I have already seen this and this questions but I have tried hard to reach a proof showing equivalence at no avail, therefore I am writing a different question.
Edit: I hadn't noticed the error in the Approach 1, which on correction would very well resolve the conflicts. Sorry for an erroneous question.