Integrals like this can often be done more easily with the Euler
substitution, here is a link: http://eom.springer.de/e/e036590.htm .
i:'integrate( sqrt(x^2+4)/(x^2+1), x );
assume(t>0)
i1:apply_nouns(scanmap(factor,changevar(i,(x+t)^2=(x^2+4),t,x)));
returns:
- ((3 * atan(((t^2 - 2)/(2 * sqrt(3)))))/(sqrt(3))) - log(t)
and:
subst(second(solve((x+t)^2=(x^2+4),t)),i1)
returns:
i2:((3 * atan((((sqrt(x^2 + 4) - x)^2 - 2)/(2 * sqrt(3)))))/(sqrt(3))) -
log(sqrt(x^2 + 4) - x)
ratsimp(diff(i2,x)-(sqrt(x^2+4)/(x^2+1))) returns 0.
To simplify the derivative:
i2d:ratsimp(diff(i2,x))
p:partition(denom(i2d),sqrt(x^2+4))
radcan(expand(num(i2d)*(second(p)-first(p)))/expand(multthru(denom(i2d)*(second(p)-first(p)))))
returns the original.
The Euler substitution seems to be another variable change that is
missing from many calc books.
Dan Stanger
Stavros Macrakis wrote:
> Hmm. Mathematica (integrals.wolfram.com
> <http://integrals.wolfram.com/index.jsp?expr=+sqrt%28x%5E2%2B4%29/%28x%5E2%2B1%29>) gets
> asin(x/2)+sqrt(3)*atan((sqrt(3)*x)/sqrt(4+x^2)), but that is not
> correct according to Maxima:
>
> ex0: sqrt(x^2+4)/(x^2+1)$
> ex1: asin(x/2)+sqrt(3)*atan(sqrt(3)*x/sqrt(4+x^2))$
>
>