Evaluate: $$ \int \frac{e^{\tan^{-1} x}}{1 + x^2} \left[ \left(\sec^{-1}\sqrt{1 + x^2}\right)^2 + \cos^{-1}\left(\frac{1 - x^2}{1 + x^2}\right) \right] dx, \quad x > 0 $$
Concept:
The presence of $\tan^{-1}x$ and $\frac{1}{1+x^2}$ strongly suggests using the substitution $x = \tan t$. This transforms the integral into the standard form $\int e^t [f(t) + f'(t)] dt = e^t f(t) + c$.
Step 1: Make the substitution $x = \tan t$.
Let $x = \tan t$. Then $t = \tan^{-1}x$ and $dx = \sec^2 t \, dt$. Also, note that $1+x^2 = 1+\tan^2 t = \sec^2 t$. Substitute these into the integral $I$: $$I = \int \frac{e^t}{\sec^2 t} \left[ \left(\sec^{-1}\sqrt{\sec^2 t}\right)^2 + \cos^{-1}\left(\frac{1-\tan^2 t}{1+\tan^2 t}\right) \right] \sec^2 t \, dt$$ The $\sec^2 t$ in the denominator and the differential cancel out: $$I = \int e^t \left[ \left(\sec^{-1}(\sec t)\right)^2 + \cos^{-1}(\cos 2t) \right] dt$$
Step 2: Simplify the inverse trigonometric terms.
Since $x>0$, we are in the first quadrant where $t \in (0, \pi/2)$. $$\sec^{-1}(\sec t) = t$$ $$\cos^{-1}(\cos 2t) = 2t$$ Substitute these simplified terms back into the integral: $$I = \int e^t [t^2 + 2t] dt$$
Step 3: Integrate using the standard exponential form.
We know the standard integral formula: $$\int e^x [f(x) + f'(x)] dx = e^x f(x) + c$$ In our integral, if we let $f(t) = t^2$, then $f'(t) = 2t$. The integral perfectly matches the form: $$I = e^t \cdot t^2 + c$$
Step 4: Substitute back the original variable x.
Replace $t$ with $\tan^{-1}x$: $$I = e^{\tan^{-1}x} (\tan^{-1}x)^2 + c$$ $$I = (\tan^{-1}x)^2 e^{\tan^{-1}x} + c$$