Integration of (a-b)^n



On Sun, Sep 19, 2010 at 12:50 PM, Ian Bell <ibell at purdue.edu> wrote:

> I want to know is how I get? integrate((a-b)^2,a) to give me the factored
> solution (a-b)^3/3 . Maxima (and Mathematica for that matter), expand
> the product

Since Maxima can do the integral with the symbolic parameter n, you
could do the following:
assume(n > 0)$
subst(n=2, integrate((a-b)^n, a));


> I've got a lot of other integrals that I have a similar problem with, like
> (a-b)^n*sin(a) with n an integer.

Unfortunately, Maxima can't do this one with the symbolic parameter.
For what it's worth, Mathematica returns something like the following:

-1/2 (a-b)^n ((a-b)^2)^(-n) ((-i (a-b))^n (cos(b)-i sin(b)) Gamma(n+1,
i (a-b))+(i (a-b))^n (cos(b)+i sin(b)) Gamma(n+1, -i (a-b)))

Although, I'm not sure exactly what you were expecting.

Mark McClure