I was thinking about this integral

$\displaystyle \int_{a}^{b} (x^2+1)^n dx$

and it's simple to calculate when n is small, but when n is big it's really time-consuming, so I thought I could be smart and rewrite it like this:

$\displaystyle \int_{a}^{b} (x^2+1)^n dx = \int_{a}^{b} e^{n(ln (x^2+1)) }$

and then integrate it. I thought it would make things easier as I figured that

$\displaystyle \int_{a}^{b} e^{f(x)} = \left [ \frac{e^{f(x)}}{f'(x)} \right ]_{a}^{b}$.

Now I thought that I could simply do this

$\displaystyle f(x) = {n(ln (x^2+1)) }$

$\displaystyle f'(x)= \frac{2nx}{x^2+1}$

which would mean that

$\displaystyle \int_{a}^{b} e^{f(x)} = \left [ \frac{e^{n(ln (x^2+1)) }}{\frac{2nx}{x^2+1}} \right ]_{a}^{b} = \left [ \frac{e^{n(ln (x^2+1))}(x^2+1)}{2nx} \right ]_{a}^{b} $.

I realized that this is dead wrong as soon as I thought of setting a to zero, but I don't know where my mistake is. Could someone please explain why this doesn't work?