Elliptic Integration in Maple
restart
Introduction
Integrals of the form ∫abaxbx yx ⅆx, with ax, bx, and yx polynomials, often return answers in closed form. For example, when yx has degree 1 or 2, the integral can always be returned in terms of elementary functions, such as logs, exponentials, trig, or arctrig functions. Thus, you have:
∫011−x1+x2⁢1+3⁢x2ⅆx=∫011−x1+x2⁢1+3⁢x2ⅆx
∫011−xx2+1⁢3⁢x2+1ⅆx=2⁢arctan⁡222−2⁢arctan⁡22+2⁢arctanh⁡222
Note that the previous example evaluated the integral in an equation with the inert form on the left-hand side in order to see the integral "prettyprinted."
When y(x) has degree 3 or 4, the integral is called an elliptic integral. Only sometimes do these return answers in terms of elementary functions. In these cases, they are called pseudo-elliptic integrals.
∫0121+x41−x4ⅆx=∫0121+x41−x4ⅆx
∫012x4+1−x4+1ⅆx=−2⁢ln⁡17−2⁢28+2⁢ln⁡17+2⁢28−2⁢arctan⁡17⁢244+π⁢28
However, in most cases, elliptic integrals return answers in terms of nonelementary functions, for example, the Legendre elliptic functions. A small variation of the previous problem gives:
∫011+x44−x4ⅆx=∫011+x44−x4ⅆx
∫01x4+1−x4+4ⅆx=−10⁢arctan⁡5216+10⁢arccoth⁡2−3⁢5⁢2532+10⁢arccoth⁡2+3⁢5⁢2532−4⁢EllipticK⁡223+15⁢EllipticPi⁡−18,2232+5⁢EllipticPi⁡98,2296
Elliptic integrals appear in a variety of applications (some mentioned in the classical text by Byrd and Friedmann). For example, the length of an arc of a hyperbola x2α2−y2β2=1 measured from the vertex to any point x,y is determined by the integral
len:=∫0y1+α2β2⁢t2+β2t2+β2ⅆt:
For example, when α=2 and β=1, the length from the vertex to the point 2 5,2 is given by
lenα=2,β=1,y=2|lenα=2,β=1,y=2
∫025⁢t2+1t2+1ⅆt
which is
ans:=value⁡
ans≔5⁢EllipticPi⁡2⁢10521,1,2⁢555
with the result given in terms of Elliptic functions. Numerically, this is approximated by
evalf⁡ans
3.267095734
Definitions of F, E, Pi
The following equations were constructed to show Maple definitions of the Legendre F, E, and Pi functions.
assume⁡0<k,k<1
EllipticF⁡x,k=∫0x11−t2⁢1−k2⁢t2ⅆt
EllipticE⁡x,k=∫0x1−k2⁢t21−t2ⅆt
EllipticPi⁡x,a,k=∫0x11−a⁢t2⁢1−t2⁢1−k2⁢t2ⅆt
with the variable k in 0,1. For x=1, you obtain the complete forms of these integrals. For example,
EllipticK⁡k=∫0111−t2⁢1−k2⁢t2ⅆt
For more information, see EllipticE, EllipticF, EllipticK, and EllipticPi.
Trigonometric Forms of Elliptic Integrals
Integrals of the form ∫0θRsint,cost ysint,cost ⅆt where R is a rational function of sint and cost and y is a degree 2 polynomial in sint and cost are elliptic integrals in trigonometric form. Corresponding forms for hyperbolic trig expressions (as above) also exist. Such integrals can also be expressed in terms of Legendre's elliptic functions. For example,
∫0π2sin⁡xⅆx=∫0π2sin⁡xⅆx
∫0π2sin⁡xⅆx=−2⁢EllipticK⁡22+2⁢2⁢EllipticE⁡22
and
∫0∞1sinh⁡xⅆx=∫0∞1sinh⁡xⅆx
∫0∞1sinh⁡xⅆx=2⁢EllipticK⁡22
In both cases you can compare the results numerically:
evalf⁡
1.198140235=1.198140235
3.708149355=3.708149354
Why Reduce to Normal Form
Because of the possible presence of poles in the integrand, elliptic integrals are often very difficult to compute numerically with standard numerical integration methods. However, the Legendre functions can be numerically evaluated very efficiently using the AGM method. Therefore, reducing to normal form allows for easy numerical evaluation. For example,
ques:=∫011x5−x+2⁢x4−3ⅆx:
ans1:=value⁡ques
ans1≔I⁢∑_α=RootOf⁡_Z5−_Z+2⁡−40⁢_α4−100⁢_α3−250⁢_α2−625⁢_α+32⁢−ln⁡3−ln⁡−−3⁢_α4+9+3⁢−14⁢_α4−12⁢_α3+14+ln⁡−−3⁢_α4+9⁢6−3⁢_α2+9⁢−12⁢_α4−12⁢_α3−12⁢_α2−12⁢_α⁢−12⁢_α4+12⁢_α3−12⁢_α2+12⁢_α−_α4+312436−I⁢2⁢334⁢∑_α=RootOf⁡_Z5−_Z+2⁡−1361⁢_α224872+1321⁢_α⁢324872+1261⁢_α24872−8712436−1337⁢_α424872+1321⁢_α324872−387⁢312436−587⁢_α4⁢324872+87⁢_α3⁢324872−1337⁢_α2⁢324872⁢EllipticPi⁡3⁢_α44+_α4⁢34−3⁢_α34−_α3⁢34+3⁢_α24+3⁢_α2⁢34−3⁢_α4−3⁢_α⁢34+32+32,226+I⁢2⁢334⁢∑_α=RootOf⁡_Z5−_Z+2⁡−1361⁢_α224872+1321⁢_α⁢324872+1261⁢_α24872−8712436−1337⁢_α424872+1321⁢_α324872−387⁢312436−587⁢_α4⁢324872+87⁢_α3⁢324872−1337⁢_α2⁢324872⁢EllipticPi⁡3−1⁢3343,3⁢_α44+_α4⁢34−3⁢_α34−_α3⁢34+3⁢_α24+3⁢_α2⁢34−3⁢_α4−3⁢_α⁢34+32+32,226
which can be (quickly) numerically approximated by
0.−0.3633182165⁢I
Of course, one can always compute the numerical approximation directly by using
evalf⁡ques
−0.3633182165⁢I
However, having a formula for an answer allows one to also compute to higher digits by using the same form:
evalf⁡ans1,30
0.−0.363318216528577575158770044176⁢I
which can also be done directly with evalf. However, in this case, the numerical integrator takes considerable time to come up with a result:
evalf⁡ques,30
−0.363318216528577575158770044176⁢I
Why Use RootOf
Let
a:=14⁢x10−4⁢x8+149⁢x6−228⁢x4+102⁢x2−93:
b:=x4−7⁢x2−1:
and consider the problem of integrating
∫01ab2⁢x4−3⁢x2+2ⅆx:
∫01ab3⁢x4−3⁢x2+2ⅆx:
The classical technique of reducing such integrals to Legendre normal form involves working with the poles of the rational function, converting the rational function to partial fractions, and reducing each "smaller" part. However, the poles of ab2 and ab3 are seen to be
poles:=solve⁡x4+x2−1
poles≔−2+2⁢52,−−2+2⁢52,I2⁢2⁢5+2,−I2⁢2⁢5+2
so all the poles involve nested radicals. Numerically, at the current setting of Digits, these are given by:
evalf⁡poles
0.7861513775,−0.7861513775,1.272019650⁢I,−1.272019650⁢I
Converting say ab3 to a complete partial fraction decomposition can be accomplished by
new_b:=mul⁡x−i,i=poles
new_b≔x−−2+2⁢52⁢x+−2+2⁢52⁢x−I⁢2⁢5+22⁢x+I⁢2⁢5+22
convert⁡anew_b3,parfrac,x
−92798976000+40475033600⁢52⁢x+−2+2⁢5⁢5−15⁢I⁢5+2+I5⁢−2+2⁢592⁢I⁢5−2+I5+11632640⁢5−286720002⁢x+−2+2⁢53⁢−2+2⁢592⁢I⁢5+2+I3⁢I⁢5−2+I3+10485760⁢I⁢175+71⁢5I⁢−2+2⁢5⁢5+I⁢−2+2⁢5+4⁢x3⁢−2+2⁢592⁢5+13⁢I⁢5+2+I3⁢I⁢5−2+I3+−6658457600+1520435200⁢5I⁢−2+2⁢5⁢5+I⁢−2+2⁢5+4⁢x2⁢5−19⁢5+14⁢I⁢5+2+I4⁢I⁢5−2+I4+3355443200⁢I⁢405+47⁢5−I⁢−2+2⁢5⁢5−I⁢−2+2⁢5+4⁢x⁢5−15⁢5+15⁢I⁢5+2+I5⁢−2+2⁢592⁢I⁢5−2+I5+−6658457600+1520435200⁢5−I⁢−2+2⁢5⁢5−I⁢−2+2⁢5+4⁢x2⁢5−19⁢5+14⁢I⁢5+2+I4⁢I⁢5−2+I4+−11632640⁢5+286720002⁢x−−2+2⁢53⁢−2+2⁢592⁢I⁢5+2+I3⁢I⁢5−2+I3+461209600−202342400⁢52⁢x−−2+2⁢52⁢5−19⁢I⁢5+2+I4⁢I⁢5−2+I4−10485760⁢I⁢175+71⁢5−I⁢−2+2⁢5⁢5−I⁢−2+2⁢5+4⁢x3⁢−2+2⁢592⁢5+13⁢I⁢5+2+I3⁢I⁢5−2+I3+92798976000−40475033600⁢52⁢x−−2+2⁢5⁢5−15⁢I⁢5+2+I5⁢−2+2⁢592⁢I⁢5−2+I5−3355443200⁢I⁢405+47⁢5I⁢−2+2⁢5⁢5+I⁢−2+2⁢5+4⁢x⁢5−15⁢5+15⁢I⁢5+2+I5⁢−2+2⁢592⁢I⁢5−2+I5+461209600−202342400⁢52⁢x+−2+2⁢52⁢5−19⁢I⁢5+2+I4⁢I⁢5−2+I4
again an expression that involves complicated nested radicals. The elliptic integration algorithm in Maple takes special care to avoid working with unnecessary radicals whenever possible. Integrals are first reduced to ones involving no repeated poles by using a classical reduction technique discovered by Hermite in the last century which introduces no new radicals during the reduction. Thus, you obtain
∫01ab2⁢x4−3⁢x2+2ⅆx=∫01ab2⁢x4−3⁢x2+2ⅆx
∫0114⁢x10−4⁢x8+149⁢x6−228⁢x4+102⁢x2−93x4−7⁢x2−12⁢x4−3⁢x2+2ⅆx=60715⁢2⁢EllipticK⁡22742−119772⁢2⁢EllipticE⁡224081+2⁢∑_α=RootOf⁡_Z4−7⁢_Z2−1⁡−1006000⁢_α2216293−4977338216293⁢EllipticPi⁡_α2−7,222
In addition, whenever possible, the elliptic integration algorithm in Maple works with an implicit rather than with an explicit representation of such roots. After Hermite reduction to eliminate multiple poles, a final answer is reduced to normal form by using the sum over roots functionality available in Maple. Thus, you obtain
∫01ab3⁢x4−3⁢x2+2ⅆx=∫01ab3⁢x4−3⁢x2+2ⅆx
∫0114⁢x10−4⁢x8+149⁢x6−228⁢x4+102⁢x2−93x4−7⁢x2−13⁢x4−3⁢x2+2ⅆx=−26481451⁢2⁢EllipticK⁡2212112408+160910307⁢2⁢EllipticE⁡2266618244+2⁢∑_α=RootOf⁡_Z4−7⁢_Z2−1⁡−19624487705⁢_α27061533864+1379712530037061533864⁢EllipticPi⁡_α2−7,222
You can evaluate this numerically by
ans:=rhs⁡
ans≔−26481451⁢2⁢EllipticK⁡2212112408+160910307⁢2⁢EllipticE⁡2266618244+2⁢∑_α=RootOf⁡_Z4−7⁢_Z2−1⁡−19624487705⁢_α27061533864+1379712530037061533864⁢EllipticPi⁡_α2−7,222
14.90025848+8.420766585×10−19⁢I
If you want to evaluate the integral numerically to higher digits, you would simply do
evalf⁡ans,50
14.900258483139842257241717964774763836672323405342+5.6084898176386662799736895664138375463221347382190×10−58⁢I
Sometimes one also uses the roots of the polynomial under the radical in an implicit rather than an explicit form. For example, you obtain (after some waiting and using alias to obtain a simpler form of answer):
y:=97⁢x4+50⁢x3+79⁢x2+56⁢x+49:
rts:=fsolve⁡y,x,complex
rts≔−0.545608960370471−0.548081748438361⁢I,−0.545608960370471+0.548081748438361⁢I,0.287877001607584−0.872783001252362⁢I,0.287877001607584+0.872783001252362⁢I
alias⁡seq⁡cat⁡R,i=RootOf⁡subs⁡x=_Z,y,index=i,i=1..4
R1,R2,R3,R4
∫011yⅆx=∫011yⅆx
∫01197⁢x4+50⁢x3+79⁢x2+56⁢x+49ⅆx=−2⁢R4−R1⁢97⁢R4−R2⁢R1R4−R1⁢R2⁢R22⁢−R2−R1⁢R3R1−R3⁢R2⁢R4⁢R2−R1R4−R1⁢R2⁢EllipticF⁡R4−R2⁢R1R4−R1⁢R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4⁢−1+R1⁢−1+R2⁢−1+R3⁢−1+R4−R22⁢R1⁢R2⁢R3⁢R4⁢R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4+2⁢R2⁢R1⁢R2⁢R3⁢R4⁢R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4−R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4⁢R1⁢R2⁢R3⁢R497⁢R2−R4⁢R2−R1⁢R1⁢R2⁢R3⁢R4⁢−1+R1⁢−1+R2⁢−1+R3⁢−1+R4
Here the answer is expressed in a (complicated) expression involving implicit roots indexed by their proximity to a numerical root. In this case, you can evaluate such an integral numerically to any number of digits by using:
ans≔−2⁢R4−R1⁢97⁢R4−R2⁢R1R4−R1⁢R2⁢R22⁢−R2−R1⁢R3R1−R3⁢R2⁢R4⁢R2−R1R4−R1⁢R2⁢EllipticF⁡R4−R2⁢R1R4−R1⁢R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4⁢−1+R1⁢−1+R2⁢−1+R3⁢−1+R4−R22⁢R1⁢R2⁢R3⁢R4⁢R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4+2⁢R2⁢R1⁢R2⁢R3⁢R4⁢R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4−R2−R4⁢−1+R1R1−R4⁢−1+R2⁢−R2−R1⁢−1+R3−1+R2⁢R1−R3⁢R2−R1⁢−1+R4R4−R1⁢−1+R2⁢EllipticF⁡−R2−R4⁢−1+R1R4−R1⁢−1+R2,−R4−R1⁢R2−R3R1−R3⁢R2−R4⁢R1⁢R2⁢R3⁢R497⁢R2−R4⁢R2−R1⁢R1⁢R2⁢R3⁢R4⁢−1+R1⁢−1+R2⁢−1+R3⁢−1+R4
0.09691069513−2.589567301×10−10⁢I
0.096910695142820439269099009374730407267346394794458+1.3044894546755286314153240166438825889924180855545×10−50⁢I
Indefinite Elliptic Integrals
You can also use a reduction procedure to return closed form solutions of Elliptic integrals in the indefinite case. In such cases, one does not return a form with elliptic functions having a k between 0 and 1; instead, an arbitrary complex number is used. For example, you have
∫2−x41−x4ⅆx=∫2−x41−x4ⅆx
∫−x4+2−x4+1ⅆx=214⁢4−2⁢2⁢x2⁢4+2⁢2⁢x2⁢EllipticF⁡x⁢2342,I4⁢−x4+2−234⁢4−2⁢2⁢x2⁢4+2⁢2⁢x2⁢EllipticF⁡x⁢2342,I−EllipticE⁡x⁢2342,I8⁢−x4+2+214⁢1−2⁢x22⁢1+2⁢x22⁢EllipticPi⁡x⁢2342,2,−22⁢2142⁢−x4+2+234⁢4−2⁢2⁢x2⁢4+2⁢2⁢x2⁢EllipticF⁡x⁢2342,I8⁢−x4+2−234⁢4−2⁢2⁢x2⁢4+2⁢2⁢x2⁢EllipticE⁡x⁢2342,I8⁢−x4+2+214⁢1−2⁢x22⁢1+2⁢x22⁢EllipticPi⁡x⁢2342,−2,−22⁢2142⁢−x4+2
a result which is verified by
ans:=:
normal⁡ⅆⅆx⁢lhs⁡ans−rhs⁡ans
0
Similarly, in the case of the trig form of elliptic integrals, you have
∫1+2⁢cos⁡xⅆx=∫1+2⁢cos⁡xⅆx
∫1+2⁢cos⁡xⅆx=2⁢4⁢cos⁡x22−1⁢sin⁡x22⁢sin⁡x22⁢−4⁢cos⁡x22+1⁢EllipticE⁡cos⁡x2,2−4⁢sin⁡x24+3⁢sin⁡x22⁢sin⁡x2⁢4⁢cos⁡x22−1
which again can be verified by
simplify⁡ⅆⅆx⁢lhs⁡ans−rhs⁡ans
See Also
diff, EllipticE, EllipticF, EllipticK, EllipticPi, evalf, Int, simplify
Return to Index for Example Worksheets
Download Help Document