Re: Integrals involving square roots
- To: mathgroup at smc.vnet.net
- Subject: [mg74008] Re: Integrals involving square roots
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Mon, 5 Mar 2007 04:56:07 -0500 (EST)
- Organization: The University of Western Australia
- References: <es90ol$2lt$1@smc.vnet.net>
In article <es90ol$2lt$1 at smc.vnet.net>, "Andre Giroux" <giroux at dms.umontreal.ca> wrote: > Hi All. > Mathematica is very unreliable when it computes integrals involving square > roots. The following were obtained running Mathematica 5.2 and 5.1 with > Windows XP pro: > > In[1]:= > \!\(\[Integral]\_\(-3\)\%3\(\[Integral]\_\(-\@\(9 - x\^2\)\)\%\(\@\(9 - > \x\^2\)\)\(\[Integral]\_0\%\(y - 3\)2 y \[DifferentialD]z \[DifferentialD]y > \[DifferentialD]x\)\)\) > Out[1]= > \!\(\(81\ \[Pi]\)\/2\) > In[5]:= > \!\(\[Integral]\_0\%2\(\[Integral]\_\(-R\)\%R\( Rz\^2\/\@\(R\^2 - x\^2\)\) > \\[DifferentialD]x \[DifferentialD]z\)\) > Out[5]= > \!\(\(-2\)\ \[Pi]\ Rz\^2\) > > In both cases, the sign is wrong and, with the first integral, it is not > obvious. Interestingly, Mathematica 5.0 computes these integrals correctly. > So beware! More than not obvious. I assume that the first integral is Integrate[2 y, {x, -3, 3}, {y, -Sqrt[9 - x^2], Sqrt[9 - x^2]}, {z, 0, y - 3}] for which Mathematica returns. (81 Pi)/2 As far as I can see, this integral _is_ correct. It certainly agrees with the numerical integral: NIntegrate[2 y, {x, -3, 3}, {y, -Sqrt[9 - x^2], Sqrt[9 - x^2]}, {z, 0, y - 3}] 127.23450236818807 For the second integral, there is no space between R and z^2 in your input expression. Moreover, telling Mathematica that R > 0, yields the correct answer: Assuming[R > 0, Integrate[(R z^2)/Sqrt[R^2 - x^2], {z, 0, 2}, {x, -R, R}]] (8 Pi R)/3 Cheers, Paul _______________________________________________________________________ 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) AUSTRALIA http://physics.uwa.edu.au/~paul