Ticket #1215 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[with patch] Sage misparses maxima integration result

Reported by: mabshoff Owned by: mabshoff
Priority: blocker Milestone: sage-2.8.13
Component: interfaces Keywords:
Cc: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description

LordRuslanNightmare? reported:

> As far as i know, length of curve, defined as
> f(x)
> from a to b (a <= x <= b) is
> L = integral from a to b of sqrt(1 + df(x)^2)dx
> where df(x) is diff(f,x)
> 
> for f(x) = y = x^2 , a=0, b=2 it should be
> df(x)=2x
> sqrt(17) + ln|4 + sqrt(17)|/4
> 
> which is 4.647
> 
> however, SAGE thinks differently. For this code:
> 
> y = x^2
> dy = diff(y,x)
> z = integral(sqrt(1 + dy^2), x, 0, 2)
> print(z)
> print(RR(z))
> 
> output is
> 
>                                  4 sqrt(17) + 4
>                                  --------------
>                                        4
> 5.12310562561766
> 
> Am i doing something wrong?

No. Maxima gives

(%i2) integrate (sqrt(1+4*x^2), x, 0, 2);
                             asinh(4) + 4 sqrt(17)
(%o2)                        ---------------------
                                       4

so possibly SAGE is not parsing that properly? That's the only thing I can think
of. The following just confirms your computation:

sage: sqrt(1 + (2*x)^2).nintegrate(x, 0, 2)
(4.6467837624329427, 1.5663635326179329e-09, 21, 0)
sage: integral(sqrt(1 + (2*x)^2), x, 0, 2)
(4 + 4*sqrt(17))/4
sage: RR(integral(sqrt(1 + (2*x)^2), x, 0, 2))
5.12310562561766

Cheers,

Michael

Attachments

trac1215.patch Download (4.4 KB) - added by was 3 years ago.

Change History

Changed 3 years ago by was

  • priority changed from major to blocker

Changed 3 years ago by was

Changed 3 years ago by mabshoff

  • owner changed from was to mabshoff
  • status changed from new to assigned

fixed: Merged in 2.8.13.rc1.

Changed 3 years ago by mabshoff

  • status changed from assigned to closed
  • resolution set to fixed

Changed 3 years ago by mhansen

  • summary changed from Sage misparses maxima integration result to [with patch] Sage misparses maxima integration result
Note: See TracTickets for help on using tickets.