# [Maxima] finding subterms in a bigger term

andre maute andre.maute at gmx.de
Mon Sep 17 08:22:02 CDT 2007

Perhaps a better simplification for the following term

--------------------------------------------------------------------------
(%o13) ((gamma (a + 1) gamma (b + 1) gamma (b + a + 3)
2             2
+ (- gamma (a + 1) gamma (b + 2) + 2 gamma(a + 1) gamma(a + 2) gamma(b +
1)
2             2              2
gamma(b + 2) - gamma (a + 2) gamma (b + 1)) gamma (b + a + 2))
2                    2
gamma (b + a + 4) + (gamma (a + 1) gamma(b + 1) gamma(b + 3)
- 2 gamma(a + 1) gamma(a + 2) gamma(b + 1) gamma(b + 2)
2                               2
+ gamma(a + 1) gamma(a + 3) gamma (b + 1)) gamma(b + a + 2) gamma (b + a
+ 3)
gamma(b + a + 4)) gamma(b + a + 5)
--------------------------------------------------------------------------

could be to simplify with the binomial theorem,
if that's the correct english term for

(x+y)^n = \sum\limits_{k=0}^{n} {n \choose k} x^{n-k} y^k

then

(- gamma(a + 1)^2 gamma(b + 2)^2
+ 2 gamma(a + 1) gamma(a + 2) gamma(b + 1) gamma(b + 2)
- gamma(a + 2)^2 gamma (b + 1)^2)

would be little bit nicer which I did by hand.

Is there some maxima functionality for this?

Andre

> >
> >Question:
> >
> >How can I find minimal n1, n2, n3 such that
> >
> >gamma(a+n1), gamma(b+n2) and gamma(a+b+n3)
> >
> >are appearing in the above term?
> >
> >I want to use gamma(x+1) = x*gamma(x)
>
> Before you write your own code to do this, try using the functions
> 'makefact' and
> 'minfactorial.' For example
>
>  (%i12) gamma (a + 1) * gamma (b + 1)  * gamma (b + a + 3) / (gamma(a) *
>  gamma(b) * gamma(a+b))$> (%i13) makefact(%)$
>  (%i14) minfactorial(%);
>  (%o14) a*b*(b+a)*(b+a+1)*(b+a+2)
>
> If this doesn't work, there are other approaches.

Sorry if I was unclear, i want to exactly imitate my calculation by hand,

factor(minfactorial(makefact(%o13))

yields a much more complex result than the one obtained by my calculation by
hand.

Is it really so difficult to find every occurences of a gamma term and inspect
it further, sorry for being perhaps ignorant but I haven't done
'advanced' term manipulation within a CAS, yet.

Regards Andre