Evaluate $\int \frac{ 2\exp\left((-\tan^2(t))/a^2\right) }{\cos^3(t)a^2}dt$ using substitution. 
Evaluate : $\displaystyle\int \frac{ 2\exp\left((-\tan^2(t))/a^2\right) }{\cos^3(t)a^2}dt$

The hint was to use $x=\cos(t)$ and the fact that $\int f'(x)e^f(x)dx=e^f(x)$.
Since $$x=\cos(t)\;\text{then}\;\tan^2(t)=\dfrac{(1-t^2)}{t^2}$$ and $$x = \cos(t) \implies \dfrac{dx}{dt} = -\sin(t) \implies dt = \dfrac{dx}{-\sin(t)}$$
If it weren't for division by $-\sin(t)$ then it would have been easy to solve as I could have used the fact that the integral of $f'(x)e^f(x)$ is $e^f(x)$ as the derivative of $\dfrac{-(1-x^2)}{x^2}$ is $\dfrac{2}{x^3}$ and everything fits nicely.
I would appreciate it if anybody can help or point out something that I did incorrectly.
 A: Given that,
$$
I=\int \frac {2}{a^2} \frac {e^{-\frac {\tan^2 t}{a^2}}}{\cos^3 t} dt
$$
Transforming $\tan t →z→\sqrt u$, we get,
$$
I=\frac {1}{a^2} \int e^{-\frac {u}{a^2}} \sqrt {1+\frac {1}{u}} du
$$
For $u>1$ we can write,
$$
\sqrt {1+\frac {1}{u}}=\sum_{k=0}^∞ { }^{\frac {1}{2}}C_k \frac {1}{u^k}
$$
Plugging in the above power series and undoing the transformations, we get our result in terms of the upper incomplete gamma functions,
$$
I=-\sum_{k=0}^∞ { }^{\frac {1}{2}}C_k \frac {\Gamma \left( 1-k, \frac {\tan^2 t}{a^2} \right)}{a^{2k}} + \text {constant}
$$
For $u<1$,we can write,
$$
e^{-\frac {u}{a^2}}≈1-\frac {u}{a^2}
$$
And our integral becomes,
$$
I≈\frac {1}{8a^4} \left[ (1+4a^2) \log \left( \frac {\sec x + \tan x}{\sec x - \tan x} \right) - 2\tan x \sec x (\tan^2 x + \sec^2 x -4a^2) \right] + \text {constant}
$$
A: It appears that I was supposed to add a sin(t) factor to the integral and then I can use the hint after I substitute and it will result in an easy solution as the sines cancel out.
I needed to evaluate this integral for a renderer program but I was supposed to add a sin(t) factor to the integral as I converted from solid angles to spherical coordinates.
