Sage==>Maxima sides with Mathematica's results



On Sep 7, 2:26 pm, William Stein <wst... at gmail.com> wrote:

sage: var('t')
t
sage: integrate((cos(t)^6+sin(t)^6)^(1/2), t,0,pi)
integrate(sqrt(sin(t)^6 + cos(t)^6), t, 0, pi)
sage: integrate((cos(t)^4+sin(t)^4)^(1/2), t,0,pi)
integrate(sqrt(sin(t)^4 + cos(t)^4), t, 0, pi)
sage: numerical_integral((cos(t)^4+sin(t)^4)^(1/2), 0,pi)[ 0 ]
2.701287762095351
sage: numerical_integral((cos(t)^6+sin(t)^6)^(1/2), 0,pi)[ 0 ]
2.4221120551366173 .

William



On 9/7/09, Alexander Povolotsky <apovolot at gmail.com> wrote:
> WolframAlpha gives
>
> 2*EllipticE[1/2]=2*E(1/2)=
>  (8*Pi^(3/2))/Gamma(-1/4)^2+Gamma(3/4)^2/sqrt(Pi)
> =2.7012877620953510050403494706774516826990447338487090906465...
>
> 2*EllipticE[3/4]=2*E(3/4) =
>  Pi*sum_(k=0)^infinity((3/4)^k*((-1/2)_k (1/2)_k))/(k!)^2
> =2.4221120551369190496071257990979573529884795994716502062707...
>
> If I input Maple's output into WolframAlpha (it understands it)
>
> EllipticE(I)*sqrt(2)=E(I)*sqrt(2)=
> 2.30857888069067525459669379819473812065849859340696523283...
> - 0.522155213609940348327414982109757688196290110066610791396... I
>
> EllipticE(sqrt(3)*I)=E(sqrt(3) I)
> =1.71922354667492421881087059097431773281393098058387700412...
> - 0.592044437093386507830834807418356168289707419289021527108... I
>
> Cheers,
> Alex
>
>
> On 9/7/09, Alexander Povolotsky <apovolot at gmail.com> wrote:
>> So we have
>>
>> Maple's
>> EllipticE(I)*sqrt(2)
>> vs
>> Mathemtica's
>> 2*EllipticE[1/2]
>>
>> and
>>
>> Maple's
>>  EllipticE(sqrt(3)*I)
>> vs
>> Mathemtica's
>>  2 EllipticE[3/4]
>>
>> In both cases above Maple has explicit  reference to the  imaginary
>> part I and Mathematica doesn't ...
>>
>> We need 3rd (package) opinion on this -
>> I will try someone who uses Scheme -
>> if you don't mind
>>
>> Cheers,
>> Alex
>> ==========================
>>> Mathematica gives:
>>> Integrate[Sqrt[Cos[t]^4 + Sin[t]^4], {t, 0, Pi}]
>>> 2 EllipticE[1/2]
>>> Integrate[Sqrt[Cos[t]^6 + Sin[t]^6], {t, 0, Pi}]
>>> 2 EllipticE[3/4]
>>> The answer for n=8 is a closed form but a very long one in Mathematica.
>>> Probably defined different in Maple...
>>> Respectfully, Roger L. Bagula
>> ---------- Forwarded message ----------
>> From    Robert Israel <israel at math.ubc.ca>
>> to      Alexander Povolotsky <apovolot at gmail.com>
>> date    Sun, Sep 6, 2009 at 11:52 PM
>> subject Re: int((cos(t)^n+sin(t)^n)^(1/2),t = 0 ... Pi)
>>
>> No, and it doesn't even have a closed form for the cases n=3, 5, 7, 8.
>>
>> For 4, EllipticE(I)*sqrt(2) and for 6, EllipticE(sqrt(3)*I)
>> (in Maple's notation).
>>
>> Cheers,
>> Robert
>> ---------- Forwarded message ----------
>> From: Alexander Povolotsky <apovolot at gmail.com>
>> Date: Sun, Sep 6, 2009 at 6:20 PM
>> Subject: int((cos(t)^n+sin(t)^n)^(1/2),t = 0 ... Pi)
>> To: Robert Israel <israel at math.ubc.ca>
>>
>> Hi Robert,
>>
>> Does Maple give general solution for
>>
>> int((cos(t)^n+sin(t)^n)^(1/2),t = 0 ... Pi) ?
>>
>> Thanks,
>> Best Regards,
>> Alexander R. Povolotsky
>> ======================================
>> The Euclidean geometry of Pi is a perimeter
>> path integral of a circle (Arc) which would seem to be no help except
>> if you increase the power n from 2:
>> Cos[t]^n+Sin[t]^n
>> the path length changes as well
>> so that the resulting lengths are a set of constants.
>> One idea is to get BBP constants that correspond
>> to the perimeters/ areas that result?
>> Then see how the probabilities change too?
>> They come out complex so I used Abs[]:
>> even and odd types...
>>
>> f[n_] = NIntegrate[Sqrt[Cos[t]^n + Sin[t]^n], {t, 0, Pi}]
>> Table[Abs[f[n]], {n, 1, 10}]
>> {2.37218, 3.14159, 2.13977, 2.70129, 1.94925, 2.42211, 1.79242,
>> 2.21359, 1.66137, 2.04744}
>> Table[{Re[f[n]], Im[f[n]]}, {n, 1, 10}]
>> {{2.30997, 0.539707}, {3.14159, 0}, {2.05179, 0.607261}, {2.70129, 0}, {
>>   1.85953, 0.584596}, {2.42211, 0}, {1.70588, 0.550206}, {2.21359, 0}, {
>>   1.57919, 0.516075}, {2.04744, 0}}
>> The even ones are real and approach 0 as a sequence
>> and Pi is a maximum.
>> The point is a sequence of arc length paths do exist.
>> To n=100 digit list: Precision seems to vary...
>> {{3.14159265358979323846264338327950288419716939937510582097494459230781640628\
>> 62089986280348253421170679821480865, 0}, \
>> {2.701287762095351005040349470677451682699044733848709091, 0}, \
>> {2.422112055136919049607125799097957352988479599471650206, 0}, \
>> {2.213585769077895679129550729440040159117567907382404634, 0}, \
>> {2.047442423361739132474366419572913078871764016464280149, 0}, \
>> {1.910564120126159443560025004958899338871617754598093612, 0}, \
>> {1.795388170229627242620305565392536787671345473798076537, 0}, \
>> {1.696977193324463054496720794410922428859538629090859302, 0}, \
>> {1.611860997044997839090168504471589086580925742168454611, 0}, \
>> {1.537485843647846833759637514912541156576199101609576610, 0}, \
>> {1.471914274877530870511807415551031676988563253054329810072414803634073487382\
>>  6401676, 0}, \
>> {1.41364431386292700218499906051251558559419237076164209942718096616504194964649710,
>> 0}, \
>> {1.361492424626956798796244116068996263897796974107479185162982498424807489098390,
>> 0},
>> {1.314513720765453025198042282899387615257241425735002020775744253486495916117,
>> 0},
>> {1.27194549680248124653718324617883953265691390048900241683658068412716559661,
>> 0},
>> {1.233166151751748243581395674788815126767302452777436550013447660689248985,
>> 0},
>> {1.1976646828747539987328090499462331645565172626542572128539696191515119,
>> 0},
>> {1.165017660085091889205694048818187262789368575888093692235722808723234,
>> 0},
>> {1.13487161813159050833593087997209070669045422544524662124209753042981,0},
>> {1.1069294440300918646190474166285392538490674435194050982620673958919,0},
>> {1.08093975365726603785977591964751358237753009952554185038851786848,0},{1.0566885315773834283421995440795218770416947939610500714226736077,
>> 0}, {1.0339925018432273524669615396326756964778505224802284399330211576,
>> 0}, {1.01269383435586136108539861264103764742158153838452713765871072,
>> 0},{0.9926558897860975092862323265440548448967109855193015878045898,
>> 0}, {0.973759777876590694991916856489920898700517877905582425798988,
>> 0}, {0.955901556983412928249009000867463834446518283588175718802993,
>> 0},{0.93898994229051158758575511111701367366581043297367189711526, 0},
>> {0.9229444199193899547149103937668621103426847644382218030155, 0},
>> {0.907693686753966406773765157394842444853176118261117749674, 0},
>> {0.89317435306266071658816068218266076906755919998680001407566, 0},
>> {0.87932985827018535397222668984336102762079695918431678501, 0},
>> {0.8661095604936419651423099323344994000732438500034057051, 0},
>> {0.8534679684373992253267070294173466834047367427683478796, 0},
>> {0.841364090479182424068008836514044456010710580561947085, 0},
>> {0.829760880680761520083068172278193759502267652656049668, 0},
>> {0.81862476532595713225029720551511916650276283207476514, 0},
>> {0.80792523665802488817587788998268094717847908554206287, 0},
>> {0.7976345029344683154491102467352868686767502705491340, 0},
>> {0.7877271858753529269720397020974487886602023212684775, 0},
>> {0.7781800581555090461631185644243520330766845973577285, 0},
>> {0.768971814862276969592464930050705499911053027062509, 0},
>> {0.760082873871341295833062260825532060160262929834251,  0},
>> {0.75149520093263308003389152082698636777431394969207, 0},
>> {0.74319215594457826218735497692240401806323910541311, 0},
>> {0.73515835745829821228888315826382658792791616227923, 0},
>> {0.7273795629175497672058561551886752357370609634891, 0},
>> {0.7198425625241253311741514856551897263382050182849, 0},
>> {0.7125350849371648286757917959651920886363218997497, 0},
>> {0.7054457132803863150029138160517420471070827609024, 0}}
>>  ====================================
>>  f[n_] = NIntegrate[Sqrt[Cos[t]^n + Sin[t]^n], {t, 0, Pi}]
>>  int((cos(t)^n+sin(t)^n)^(1/2),t = 0 .. Pi)
>>
>