simplify_sum error



On Tue, Mar 13, 2012 at 8:00 AM, Aleksas Domarkas <aleksasd873 at gmail.com> wrote:
> ?I calculate integral
> integrate(sqrt(x)*sqrt(1+x^2), x, 0, 1);
>
> The answer should be
> (%i1) 2/3*hypergeometric([-1/2,3/4],[7/4],-1);
> (%o1) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3
> (%i2) a1:float(%), numer;
> (%o2) 0.79248561598088
>
> (%i3) quad_qags(sqrt(x)*sqrt(1+x^2), x, 0, 1);
> (%o3) [0.79248561598088,1.0454970222895099*10^-12,231,0]
>
> (%i4) load(simplify_sum)$
> (%i5) sqrt(x)*niceindices(powerseries(sqrt(1+x^2),x,0));
> (%o5) (2*sqrt(x)*sum(x^(2*i)/beta(3/2-i,i+1),i,0,inf))/3
>
> (%i6) intosum(%);
> (%o6) sum((2*x^(2*i+1/2))/(3*beta(3/2-i,i+1)),i,0,inf)
>
> (%i7) integrate(%,x);
> (%o7) (2*sum(x^(2*i+3/2)/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3
>
> (%i8) sol:ev(%,x=1)-ev(%,x=0);
> (%o8) (2*sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3
>
> (%i9) simplify_sum(sol);
> expt: undefined: 0 to a negative exponent.
> #0:
> to_hypergeometric1(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac
> line 781)
> #1:
> to_hypergeometric(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac
> line 743)
> #2:
> simplify_sum(expr='sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))(simplify_sum.mac
> line 292)
> ?-- an error. To debug this try: debugmode(true);

simplify_sum finds that this sum equals 2/3*hypergeometric([-1/2,
3/4],[7/4],-1). The error comes from hgfred:

(%i1) 2/3*hgfred([-1/2,3/4],[7/4],-1);
expt: undefined: 0 to a negative exponent.
 -- an error. To debug this try: debugmode(true);

Numerical evaluation using the hypergeometric package agrees with your
numerical integration:

(%i2) 2/3*hypergeometric([-1/2,3/4],[7/4],-1);
(%o2) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3
(%i3) float(%);
(%o3) .7924856159808843

HTH, Andrej