1. ## Integration mistake

$\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?

2. ## Re: Integration mistake

Originally Posted by scounged

$\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}$.
How did you get that equation? It doesn't look right to me. I'd believe this:

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

But I don't think you can just yank the $\displaystyle f'(x)$ out of the integral and divide both sides by it. In addition, if you differentiate the RHS, you don't get the integrand on the LHS.

The integral you're trying to do is not trivial. Mathematica gives hypergeometric functions $\displaystyle _{2}F_{1}$ thus:

$\displaystyle \int_{a}^{b}(x^{2}+1)^{n}\,dx=b\; _{2}F_{1}\left[\frac{1}{2},-n,\frac{3}{2},-b^{2}\right]-a\;_{2}F_{1}\left[\frac{1}{2},-n,\frac{3}{2},-a^{2}\right].$

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?

3. ## Re: Integration mistake

Originally Posted by scounged

$\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}$.
No, that's wrong. The derivative of $\displaystyle \frac{e^{f(x)}}{f'(x)}$, using the quotient rule, is $\displaystyle \frac{(f')^2(x)e^{f(x)}- e^{f(x)}f''(x)}{(f'(x))^2}$ which is NOT $\displaystyle e^{f(x)}$.

The idea that one can do a substitution by simply dividing by the derivative is one that many students get because the first examples use constants.

For example, if the problem were $\displaystyle \int e^{ax}dx$ then I can certanly say, "I can multiply and divide by a to get $\displaystyle \frac{a}{a}\int e^{ax}dx= \frac{1}{a}\int ae^{ax}(dx)$ and, since $\displaystyle d(e^{ax})= ae^{ax}dx$, so the integral is $\displaystyle \frac{1}{a}e^{ax}$.

But we CANNOT do that with functions. To integrate $\displaystyle \int e^{f(x)}dx$ I might say "The derivative of f(x) is f'(x) so I can multiply and divide by 1/f'(x) to get
(Warning- this next line is wrong!)
$\displaystyle \frac{f'(x)}{f'(x)}\int e^{f'(x)}dx= \frac{1}{f'(x)}\int f'(x)e^{f(x)}dx$
and now the integration is easy! But I cannot just take that "f'(x)" inside the integral sign like that. I can do it with constants because (a g(x))'= a(g(x))' but not with functions of x because (f(x)g(x))'= f'(x)g(x)+ f(x)g'(x), not just "f(x)g'(x)".
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?

4. ## Re: Integration mistake

Yes! The quotient rule! I totally forgot about it. A stupid mistake really, thanks for the help.