#### 6.74 assume, multiple assumptions (16.3.98)

##### 6.74.1 Lucy Schloesser

The function p(k,n) with k,n Integer and n>=k>=0 is deﬁned as follows.

> assume(n, posint);
> assume(k, posint);
> assume(n>=k);
> assume(k>=0);
> p:=x^k*(1-x)^(n-k)*binomial(n, k);

I want maple to solve int(x^k*(1-x)^(n-k)*binomial(n,k), x=0..1); . It is = 1/(n+1); (with integration by parts)

> int(p, x=0..1);

Deﬁnite integration: Can’t determine if the integral is convergent. Need to know the sign of --> -n+k

Will now try indeﬁnite integration and then take limits. Has someone written a program to solve this problem?

##### 6.74.2 Douglas B. Meade (17.3.98)

To obtain the expected result of this calculation it is necessary to use a little caution in the way assumptions are declared. In particular, the assume command overrides previous assumptions; to add assumptions the additionally command should be used. To illustrate the diﬀerence, use the about command to query the current assumptions about a speciﬁc Maple name. All of this, together with the simpliﬁcations necessary to obtain the simpliﬁed form for your integral are contained in the Maple session attached to the end of this message.

> restart;
> p:=x^k*(1-x)^(n-k)*binomial(n, k):
n:

k:

>
> assume(n, posint);
> assume(k, posint);
> assume(n>=k);            # overrides both previous assumptions!
> assume(k>=0);
Originally n, renamed n~:

Originally k, renamed k~:
is assumed to be: RealRange(0,infinity)

>
> assume(n, posint);
> assume(k, posint);
> #assume(k>=0);         # unneeded since k is already positive
Originally n, renamed n~:
Involved in the following expressions with properties
-n+k assumed RealRange(-infinity,0)
is assumed to be: AndProp(RealRange(1,infinity),integer)
also used in the following assumed objects
[-n+k] assumed RealRange(-infinity,0)

Originally k, renamed k~:
Involved in the following expressions with properties
-n+k assumed RealRange(-infinity,0)
is assumed to be: AndProp(RealRange(1,infinity),integer)
also used in the following assumed objects
[-n+k] assumed RealRange(-infinity,0)

> A := int( p, x=0..1 );

A := binomial(n, k) Beta(k + 1, 1 + n - k)

>
> convert( A, GAMMA );

GAMMA(n + 1)
------------
GAMMA(2 + n)

>  simplify( % );

1
-----
n + 1