Re: LegendreP (Symbolic) is different in Mathematica5 than previous versions (M4, M3 ..)
- To: mathgroup at smc.vnet.net
- Subject: [mg51877] Re: LegendreP (Symbolic) is different in Mathematica5 than previous versions (M4, M3 ..)
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Thu, 4 Nov 2004 01:49:28 -0500 (EST)
- Organization: The University of Western Australia
- References: <200410160820.EAA23725@smc.vnet.net> <DCE69724-1F76-11D9-9EF0-000A95B4967A@mimuw.edu.pl> <cl2fa3$mp1$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <cl2fa3$mp1$1 at smc.vnet.net>, "Peter S Aptaker" <psa at laplacian.co.uk> wrote: > Thanks. As with much or most use of LegendreP the argument mu is real. My > point and concern is in the Subject: Real -- but over what range? And I disagree that the argument z (mu is usually used as one of the parameters) is usually real, at least in the applications I need it for. I assume that you are restricting attention to z = x in -1 < x < 1. In that case, Andrzej Kozlowski's suggestion of using P[n_, m_, x_] := (-1)^m (1 - x^2)^(m/2) D[LegendreP[n, x], x] (for m >= 0) is one way to go. Remember, Mathematica is designed to work with functions (and parameters and arguments) assumed to be complex, in general. > "LegendreP (Symbolic) is different in Mathematica 5 than previous versions > (M4, M3 ..)" > > Your comment means ttht the Mathematica 5 result is not simply 'a different > form' but 'the wrong answer'? The answer is _not_ wrong. If you look at the online documentation for LegendreP you will see that it accepts FOUR arguments. By default LegendreP[1,1,mu] gives the "Type 1" case, which is defined only for z within the unit circle in the complex plane. Indeed, although FullSimplify[Sqrt[(-z - 1)/(z - 1)] (z - 1) + Sqrt[1 - z^2], Abs[z] < 1] returns 0, FullSimplify fails to reduce Sqrt[(-z - 1)/(z - 1)] (z - 1) to -Sqrt[1 - z^2]. But the result is not wrong. The definition needs to handle different possible branch cuts. For example, Type 3 functions have a single branch cut from -Infinity to +1. Cheers, Paul > ----- Original Message ----- > From: "Andrzej Kozlowski" <akoz at mimuw.edu.pl> To: mathgroup at smc.vnet.net > Subject: [mg51877] Re: LegendreP (Symbolic) is different in Mathematica5 > than previous versions (M4, M3 ..) > > > > On 16 Oct 2004, at 17:20, peteraptaker wrote: > > > >> LegendreP[1,1,mu] > >> Out[with m4] = -Sqrt[1 - mu^2] > >> Out[with m5] = Sqrt[(-1 - mu)/(-1 + mu)]*(-1 + mu) > >> > >> While this ( and common sense) show they are equal .. > >> > >> dum = m4 - m5 // FullSimplify > >> PowerExpand[dum] > >> Out[]= 0 > >> > > > > Well, it seems to me that the commonsense thing to do in such situations > > is not to rely too much on common sense and even less on PowerExpand. In > > fact your two expressions are certainly not equal: > > > > a[mu_] := -Sqrt[1 - mu^2]; > > b[mu_] := Sqrt[(-1 - mu)/(-1 + mu)]*(-1 + mu); > > > > a[2] > > (-I)*Sqrt[3] > > > > FullSimplify[b[2]] > > > > I*Sqrt[3] > > > > > > Andrzej Kozlowski > > Chiba, Japan > > http://www.akikoz.net/~andrzej/ > > http://www.mimuw.edu.pl/~akoz/ > > > > > > -- Paul Abbott Phone: +61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) 35 Stirling Highway Crawley WA 6009 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul