Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!newsfeed.stanford.edu!newshub.sdsu.edu!flph200.ffdc.sbc.com!prodigy.net!flph199.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!flpi144.ffdc.sbc.com.POSTED!ffbda4aa!not-for-mail
Reply-To: "Nasser Abbasi" <nma@12000.org>
From: "Nasser Abbasi" <nma@12000.org>
Newsgroups: comp.soft-sys.matlab
References: <gl8cd6$4rj$1@fred.mathworks.com>
Subject: Re: elliptic integral strangeness
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
Message-ID: <y9Sdl.5462$jZ1.5236@flpi144.ffdc.sbc.com>
NNTP-Posting-Host: 75.38.110.8
X-Complaints-To: abuse@prodigy.net
X-Trace: flpi144.ffdc.sbc.com 1232596702 ST000 75.38.110.8 (Wed, 21 Jan 2009 22:58:22 EST)
NNTP-Posting-Date: Wed, 21 Jan 2009 22:58:22 EST
Organization: at&t http://my.att.net/
X-UserInfo1: OXZUSWKOG@C_GFLYZBNXKQ@@AZJTB_LILIXNMVMHQYUJUZ]CCVWCPG[YMDXZH^[K[FFQZHBM@FX\NJOCW^TGNQLFRFU_HSDIHX[FCUWCXLP@PBL\BKFXXVGCM\CCKFVL_T[GJLBM@Q^]WKGS]T]M^NG_YKYVGV_IJYXS@MCBT[@JPRXECDFZMSXG]NVQQTJL
Date: Wed, 21 Jan 2009 20:00:19 -0800
Xref: news.mathworks.com comp.soft-sys.matlab:513072


"Matthew " <mwk5v@virginia.edu> wrote in message 
news:gl8cd6$4rj$1@fred.mathworks.com...
> Hello everyone,
>
> I'm trying to evaluate a symbolic integral in Matlab whose solution is a 
> linear combination of two elliptic integrals, but Matlab does not appear 
> to evaluate the integral correctly. The integral that I am trying to 
> evaluate is:
>
> E = sin^2(x)*sqrt(sin^2(x) + m*cos^2(x)),    0 <= m <= 1
>
> I want to integrate with respect to x, for x = 0..pi.
>
> At the limits of m, the solution is in closed-form and becomes a trivial 
> integral
>
> m=0:   E = sin^2(x)*sqrt(sin^2(x)) = sin^3(x),  whose integral from 
> x=0..pi is simply 4/3.
>
> m=1: E = sin^2(x)*sqrt[sin^2(x)+cos^2(x)] = sin^2(x)  since 
> sin^2(x)+cos^2(x)=1, and the integral is simply  pi/2.
>
> However, when I take the integral in Matlab, I get the following 
> expression:
>
> int(E) = 2/3*[m*K(g)+(m-2)*E(g)]/(m-1),     g=sqrt(1-m)
>
> where K(g) is the complete integral of the first kind, and E(g) is the 
> complete integral of the second kind. Substituting m=0 into this 
> expression gives the correct value for int(E) = 4/3, but substituting 
> m=0.99999999999 into this expression (since m-1 would yield a division by 
> zero error), gives a very large value. Indeed, as m->1, int(E) -> -Inf.  I 
> haven't been able to get anywhere on this problem for the last few days, 
> and any assistance the community can provide would be greatly appreciated.
>
> Thanks,
> Matt
>

Hi Mathews;

I could confirm your results using Mathematica 7 as well:

Mathematica 7.0 for Students: Microsoft Windows (32-bit) Version

In[1]:= r = Assuming[Element[m, Reals] && 0 <= m <= 1,
           Integrate[Sin[x]^2*Sqrt[Sin[x]^2 + m*Cos[x]^2], {x, 0, Pi}]];

In[2]:= Limit[r, m -> 0]

                4
Out[2]=    -
                3

In[3]:= Limit[r, m -> 1]

                Pi
Out[3]=   --
                 2

If you are not getting this using Matlab symbolic toolbox, may be you should 
report it to Mathworks with version number and commands used.

--Nasser