# [Maxima] finding subterms in a bigger term

andre maute andre.maute at gmx.de
Mon Sep 17 08:14:04 CDT 2007

```On Monday 17 September 2007, you wrote:
> BW
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
> >To: maxima at math.utexas.edu
> >From: andre maute
> >Sent by: maxima-bounces at math.utexas.edu
> >Date: 09/17/2007 04:50AM
> >Subject: [Maxima] finding subterms in a bigger term
> >
> >Hi Maxima mailinglist,
> >
> >I'm experimenting with non-classical orthogonal polynomials.
> >
> >I have set,
> >
> >gammalim : -2;
> >
> >because I don't want the gamma function to be evaluated.
> >
> >I have the constraints
> >a > -1, a real, and b > -1, b real
> >but they are not used within my Maxima source at the moment.
> >
> >I have terms being polynomial in gamma terms like the following
> >
> >--------------------------------------------------------------------------
> >----
> >(%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)
> >--------------------------------------------------------------------------
> >----
> >
> >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
```