# Evaluate the following: $\int e^{\tan^{-1}x}\bigg(\frac{1+x+x^2}{1+x^2}\bigg)dx$

Toolbox:
• Method of integration by parts
• $\int udv=uv-\int vdu$
• $1+\tan ^2 x=\sec^2 x$
Step 1:
Let $I=\large\int e^{\tan^{-1}x}\bigg(\large\frac{1+x+x^2}{1+x^2}\bigg)dx$
we can rewrite this
$I=\int\Large \frac{e^{\tan ^{-1}x}}{1+x^2}$$(1+x+x^2)dx$
Put $\tan ^{-1} x=t=>x=\tan t$
On differentiating with respect to t we get
$\large\frac{dx}{1+x^2}=dt$
Now substituting this we get,
$I=\int e^t(1+\tan t+\tan ^2 t)dt$
$=\int e^t(1+\tan ^2 t+\tan t)dt$
$1+\tan ^2 dt$
$=\int e^t(\sec ^2 t+\tan t)dt$
Now splitting the terms we get
$=\int e^t \sec ^2t dt+\int e^t. \tan t.dt$
Step 2:
Consider $\int e^t\; \tan t\; dt$
This is of the form $\int udv,$ hence this can be solved by the method of integration by parts.
$\int udv=uv-\int vdu$
Let $u=\tan t\qquad dv=e^t.dt$
$du=\sec^2 t\; dt \qquad v=e^t$
Hence $I=e^t.\tan t-\int e^t.\sec ^2 t.e^t.dt+\int e^t.\sec^2t.dt$
$=e^t.\tan t$
Substituting for t we get
$I=x.e^{\tan ^{-1}}x+c$