Does anybody know if either Matlab or Mathematica is capable of doing this
integral? If so, is it capable of working that result into slightly a more
complicated integral, like the integral of du*(c1-c2*u)/[S(u)*(1-u^2)].
TIA
> If I define S(u) = sqrt((a1-u)(a2-u)(a3-u)), ie. the square root of a cubic
> polynomial, I recently learned that the integral of du/S(u) = b1*F(b2,b3),
> where F is the elliptic integral of the first kind and b1,b2,b3 are derived
> constants that are simple functions of the input constants a1,a2,a3.
>
> Does anybody know if either Matlab or Mathematica is capable of doing this
> integral?
I would think so. Maple says:
> S := sqrt((a1-u)*(a2-u)*(a3-u));
S := ((a1-u)*(a2-u)*(a3-u))^(1/2)
> int(1/S,u);
2*(a2-a1)*((-a1+u)/(a2-a1))^(1/2)*((-a3+u)/(a1-a3))^(1/2)*
((-a2+u)/(a1-a2))^(1/2)
*EllipticF(((-a1+u)/(a2-a1))^(1/2),((a1-a2)/(a1-a3))^(1/2))/
(a1*a2*a3-a1*a2*u-a1*u*a3+a1*u^2-a2*u*a3+a2*u^2+u^2*a3-u^3)^(1/2)
> If so, is it capable of working that result into slightly a more
> complicated integral, like the integral of du*(c1-c2*u)/[S(u)*(1-u^2)].
>
> int((c1-c2*u)/(S*(1-u^2)),u);
2*(-1/2*c1+1/2*c2)*(a2-a1)*((-a1+u)/(a2-a1))^(1/2)
*((-a3+u)/(a1-a3))^(1/2)*((-a2+u)/(a1-a2))^(1/2)
*EllipticPi(((-a1+u)/(a2-a1))^(1/2), (a1-a2)/(a1-1),
((a1-a2)/(a1-a3))^(1/2))/((a1*a2*a3-a1*a2*u-a1*u*a3+a1*u^2
-a2*u*a3+a2*u^2+u^2*a3-u^3)^(1/2)*(a1-1))
+2*(1/2*c1+1/2*c2)*(a2-a1)*((-a1+u)/(a2-a1))^(1/2)
*((-a3+u)/(a1-a3))^(1/2)*((-a2+u)/(a1-a2))^(1/2)
*EllipticPi(((-a1+u)/(a2-a1))^(1/2), (a1-a2)/(a1+1),
((a1-a2)/(a1-a3))^(1/2))/((a1*a2*a3-a1*a2*u-a1*u*a3+a1*u^2
-a2*u*a3+a2*u^2+u^2*a3-u^3)^(1/2)*(a1+1))
> If I define S(u) = sqrt((a1-u)(a2-u)(a3-u)), ie. the square root of a cubic
> polynomial, I recently learned that the integral of du/S(u) = b1*F(b2,b3),
> where F is the elliptic integral of the first kind and b1,b2,b3 are derived
> constants that are simple functions of the input constants a1,a2,a3.
You might want to read Section 6.11 of the Numerical Recipes book,
available online at
http://www.library.cornell.edu/nr/bookcpdf.html
> Does anybody know if either Matlab or Mathematica is capable of doing this
> integral?
Mathematica can compute this integral:
s[u_] = Sqrt[(a1 - u) (a2 - u) (a3 - u)];
Integrate[1/s[u], u]
(2*(a1 - u)^(3/2)*Sqrt[(a2 - u)/(a1 - u)] Sqrt[(a3 - u)/(a1 - u)]*
EllipticF[ArcSin[Sqrt[a1 - a2]/Sqrt[a1 - u]],
(a1 - a3)/(a1 - a2)])/
(Sqrt[a1 - a2] Sqrt[(a1 - u) (u - a2) (u - a3)])
> If so, is it capable of working that result into slightly a more
> complicated integral, like the integral of du*(c1-c2*u)/[S(u)*(1-u^2)].
Yes.
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
Would you be willing to run another one for me that is only
infinitessimally different from the last one?
The integral is
phi=int{du*u*(c1-c2*u)/[S(u)*(1-u^2)]}
Feel free to let me know what I can do to repay for your professional
efforts. If you can do the above integral and three more similar ones,
I'd be happy to make you a co-author on the paper.
> >> If so, is it capable of working that result into slightly a more
> >> complicated integral, like the integral of
> >> du*(c1-c2*u)/[S(u)*(1-u^2)].
> >>
> >
> >> int((c1-c2*u)/(S*(1-u^2)),u);
> > 2*(-1/2*c1+1/2*c2)*(a2-a1)*((-a1+u)/(a2-a1))^(1/2)
> > *((-a3+u)/(a1-a3))^(1/2)*((-a2+u)/(a1-a2))^(1/2)
> > *EllipticPi(((-a1+u)/(a2-a1))^(1/2), (a1-a2)/(a1-1),
> > ((a1-a2)/(a1-a3))^(1/2))/((a1*a2*a3-a1*a2*u-a1*u*a3+a1*u^2
> > -a2*u*a3+a2*u^2+u^2*a3-u^3)^(1/2)*(a1-1))
> > +2*(1/2*c1+1/2*c2)*(a2-a1)*((-a1+u)/(a2-a1))^(1/2)
> > *((-a3+u)/(a1-a3))^(1/2)*((-a2+u)/(a1-a2))^(1/2)
> > *EllipticPi(((-a1+u)/(a2-a1))^(1/2), (a1-a2)/(a1+1),
> > ((a1-a2)/(a1-a3))^(1/2))/((a1*a2*a3-a1*a2*u-a1*u*a3+a1*u^2
> > -a2*u*a3+a2*u^2+u^2*a3-u^3)^(1/2)*(a1+1))
>
> Would you be willing to run another one for me that is only
> infinitessimally different from the last one?
>
> The integral is
>
> phi=int{du*u*(c1-c2*u)/[S(u)*(1-u^2)]}
This integral can be obtained by parametric differentiation. Since
-D[(c1-c2 u), c2]
is u, the integral you are after is just
-D[Integrate[(c1-c2 u)/(S[u] (1-u^2)),u], c2]
which is trivial.
> Feel free to let me know what I can do to repay for your professional
> efforts. If you can do the above integral and three more similar ones,
> I'd be happy to make you a co-author on the paper.
As a journal referee, I would not be interested in such algebraic
expressions. Firstly, any decent CAS can compute these integrals, so why
publish the analytical expression in all its gory detail. Secondly, what
are you really trying to do? A closed-form expression is often useful
but, unless you have access to numerical codes that can compute
EllipticPi, what is the use of such expressions _outside_ a CAS?
Thirdly, the "canonical" forms discussed in Numerical Recipes may be
more useful for analytical computation.
For the integral above, Mathematica (version 5.1) gives
((-I)*(a1 - u)^(3/2)*Sqrt[(a2 - u)/(a1 - u)]*
Sqrt[(a3 - u)/(a1 - u)]*
(2*a1*(-c1 + a1*c2)*EllipticF[
I*ArcSinh[Sqrt[-a1 + a2]/Sqrt[a1 - u]],
(a1 - a3)/(a1 - a2)] + (1 + a1)*(c1 - c2)*
EllipticPi[(-1 + a1)/(a1 - a2),
I*ArcSinh[Sqrt[-a1 + a2]/Sqrt[a1 - u]],
(a1 - a3)/(a1 - a2)] + (-1 + a1)*(c1 + c2)*
EllipticPi[(1 + a1)/(a1 - a2),
I*ArcSinh[Sqrt[-a1 + a2]/Sqrt[a1 - u]],
(a1 - a3)/(a1 - a2)]))/((-1 + a1^2)*
Sqrt[-a1 + a2]*Sqrt[(a1 - u)*(-a2 + u)*(-a3 + u)])
I think you should be able to get that same result for yourself using
Wolfram's free Integrator at <http://integrals.wolfram.com/index.jsp>.
Please be aware that there are different conventions for notating elliptic
integrals. For example, Mathematica's convention (see
<http://functions.wolfram.com/EllipticIntegrals/>) is different from
Maple's in some respects.
David
> In article <Xns978813762F34Dlk...@207.115.17.102>,
> John Schutkeker <jschu...@sbcglobal.net.nospam> wrote:
>
>> >> If so, is it capable of working that result into slightly a more
>> >> complicated integral, like the integral of
>> >> du*(c1-c2*u)/[S(u)*(1-u^2)].
>>
>> Would you be willing to run another one for me that is only
>> infinitessimally different from the last one?
>>
>> The integral is
>>
>> phi=int{du*u*(c1-c2*u)/[S(u)*(1-u^2)]}
>
> This integral can be obtained by parametric differentiation. Since
>
> -D[(c1-c2 u), c2]
>
> is u, the integral you are after is just
>
> -D[Integrate[(c1-c2 u)/(S[u] (1-u^2)),u], c2]
>
> which is trivial.
That's a handy trick that they don't teach at MIT. Would you care to
tell me how to do the first integral without using Maple?
> As a journal referee, I would not be interested in such algebraic
> expressions. Firstly, any decent CAS can compute these integrals, so
> why publish the analytical expression in all its gory detail.
Believe me, this sort of routine crap would never make it into the final
paper.
> Secondly, what are you really trying to do?
That information is confidential until the paper is accepted for
publication.
> A closed-form expression
> is often useful but, unless you have access to numerical codes that
> can compute EllipticPi, what is the use of such expressions _outside_
> a CAS?
A closed form expression is useful as input into another purely
mathematical problem that tries to find more closed form expressions for
completely new derivations that had once been impossible, for lack of
the original solution. The wonderful thing about science is that, once
you walk through a freshly opened door, there are a whole bunch of new
doors on the other side of it, just waiting for some clever guy to
figure out a way to open them.
> Thirdly, the "canonical" forms discussed in Numerical Recipes
> may be more useful for analytical computation.
I looked at that, but unfortunately Numerical Recipes doesn't tell you
how to transform the most general integral 6.7.1 into the canonical
form, from which the solution in terms of PI_elliptical and F_elliptical
will follow directly. I could really use a reference that explains
that, so I don't have to rely on a CAS.
No matter how good they are, the results from a CAS are always messier
than what a person generates by hand. I *like* doing algebra and
calculus, but this was one of those occasions when I ran up against an
integral I couldn't do. I'm doing quite well for a guy who just taught
himself about elliptical integrals two years ago.
> John Schutkeker <jschu...@sbcglobal.net.nospam> wrote:
>> A N Niel <ann...@nym.alias.net.invalid> wrote in
>> news:140320060945574292%ann...@nym.alias.net.invalid:
>>
>> > In article <Xns97865EF0DE6C9lk...@207.115.17.102>,
>> > John Schutkeker <jschu...@sbcglobal.net.nospam> wrote:
>> >
>> >> If I define S(u) = sqrt((a1-u)(a2-u)(a3-u)), ie. the square root
>> >> of a cubic polynomial, I recently learned that the integral of
>> >> du/S(u) = b1*F(b2,b3), where F is the elliptic integral of the
>> >> first kind and b1,b2,b3 are derived constants that are simple
>> >> functions of the input constants a1,a2,a3.
>> >>
>> >> Does anybody know if either Matlab or Mathematica is capable of
>> >> doing this integral?
>> >
>> > I would think so. Maple says:
>> >
>> >> S := sqrt((a1-u)*(a2-u)*(a3-u));
>> >
>> >> If so, is it capable of working that result into slightly a more
>> >> complicated integral, like the integral of
>> >
>> >> du*(c1-c2*u)/[S(u)*(1-u^2)].
>>
>> The integral is
>>
>> phi=int{du*u*(c1-c2*u)/[S(u)*(1-u^2)]}
>
> I think you should be able to get that same result for yourself using
> Wolfram's free Integrator at <http://integrals.wolfram.com/index.jsp>.
Dave, that tool is friggin' amazin'!!! I can sweep these integrals out of
my project and not have to teach myself Maple. Nor do I have to ask other
people to do my integrals for me. I owe you a big, fat, favor, my friend.
Is there a way to export those equations into an equation typesetter, so I
don't can tidy them up without having to type them in again, verbatim? I
use MathType, but I'm willing to learn a new one if I need to.
> > This integral can be obtained by parametric differentiation. Since
> >
> > -D[(c1-c2 u), c2]
> >
> > is u, the integral you are after is just
> >
> > -D[Integrate[(c1-c2 u)/(S[u] (1-u^2)),u], c2]
> >
> > which is trivial.
>
> That's a handy trick that they don't teach at MIT.
Are you sure that parametric differentiation is not taught at MIT? See
http://www-math.mit.edu/~djk/18_01/chapter25/section01.html
> Would you care to tell me how to do the first integral without using Maple?
First use partial fractions on (c1-c2 u)/(1-u^2). You wrote that
> I recently learned that the integral of
> du/S(u) = b1*F(b2,b3), where F is the elliptic integral of the
> first kind and b1,b2,b3 are derived constants that are simple
> functions of the input constants a1,a2,a3.
Now look up the defining integral for EllipticPi. Then you will see that
the first integral is a sum of EllipticF and EllipticPi functions.
> I looked at that, but unfortunately Numerical Recipes doesn't tell you
> how to transform the most general integral 6.7.1 into the canonical
> form, from which the solution in terms of PI_elliptical and F_elliptical
> will follow directly.
I assume you mean 6.11.1?
> I could really use a reference that explains
> that, so I don't have to rely on a CAS.
But Numerical Recipes gives you a reference to Erdelyi et al (1953),
which describes how to do this reduction.
> No matter how good they are, the results from a CAS are always messier
> than what a person generates by hand.
Not always. As a particular example, modern CAS return the roots of
solutions to polynomial equations in an implicit form (a Root or RootOf
object) that is much more useful than explicit expressions involving
radicals. Also, integrals will often be expressed compactly as
generalized hypergeometric functions or MeijerG functions that few
humans would obtain by hand.
> In article <Xns9788A6123287Clk...@207.115.17.102>,
> John Schutkeker <jschu...@sbcglobal.net.nospam> wrote:
>
>> > This integral can be obtained by parametric differentiation. Since
>> >
>> > -D[(c1-c2 u), c2]
>> >
>> > is u, the integral you are after is just
>> >
>> > -D[Integrate[(c1-c2 u)/(S[u] (1-u^2)),u], c2]
>> >
>> > which is trivial.
>>
>> That's a handy trick that they don't teach at MIT.
>
> Are you sure that parametric differentiation is not taught at MIT? See
>
> http://www-math.mit.edu/~djk/18_01/chapter25/section01.html
Because I got a 5 (max. score) on the AB (easy test) exam in advanced
placement calculus, in '78, I placed out of 18.01 and into 18.01C, which
only lasted six weeks. That was before Thomas's text became Thomas &
Finney. It does seem vaguely familiar, though, as though I saw it once,
in lecture, 28 years ago, and never saw it again. I'll put it in my bag
of tricks and try it out if I see someplace where it might be useful.
>> Would you care to tell me how to do the first integral without using
>> Maple?
>
> First use partial fractions on (c1-c2 u)/(1-u^2).
I get (c1+c2)/2(1-u) + (c1-c2)/2(1+u)
> You wrote that
>> I recently learned that the integral of
>> du/S(u) = b1*F(b2,b3), where F is the elliptic integral of the
>> first kind and b1,b2,b3 are derived constants that are simple
>> functions of the input constants a1,a2,a3.
>
> Now look up the defining integral for EllipticPi.
OK, there are three versions, in terms of x, y & sin(phi).
> Then you will see
> that the first integral is a sum of EllipticF and EllipticPi
> functions.
I did this for the x & y representations and I got
y: F+PI = Int(du(2+n*u^2)/(1+nu^2)*sqrt((1-y^2)(1-k^2y^2))
x: F+PI = Int(du(2+p*u^2)/(1+pu^2)*sqrt((1+x^2)(1+kc^2x^2))
I still don't see the relation between the partial fraction expansion
and F+PI.
>> I looked at that, but unfortunately Numerical Recipes doesn't tell
>> you how to transform the most general integral 6.7.1 into the
>> canonical form, from which the solution in terms of PI and
>> F will follow directly.
>
> I assume you mean 6.11.1?
Grumble. I'm using the 1986 version, which only goes up to Sec. 6.7.
>> I could really use a reference that explains
>> that, so I don't have to rely on a CAS.
>
> But Numerical Recipes gives you a reference to Erdelyi et al (1953),
> which describes how to do this reduction.
I'll look it up next time I'm in the library.
Perhaps use the on-line version:
<http://www.library.cornell.edu/nr/bookcpdf.html>.
David
[snip]
>I did this for the x & y representations and I got
>
>y: F+PI = Int(du(2+n*u^2)/(1+nu^2)*sqrt((1-y^2)(1-k^2y^2))
>
>
>x: F+PI = Int(du(2+p*u^2)/(1+pu^2)*sqrt((1+x^2)(1+kc^2x^2))
>
>I still don't see the relation between the partial fraction expansion
>and F+PI.
>
>>> I looked at that, but unfortunately Numerical Recipes doesn't tell
>>> you how to transform the most general integral 6.7.1 into the
>>> canonical form, from which the solution in terms of PI and
>>> F will follow directly.
>>
>> I assume you mean 6.11.1?
>
>Grumble. I'm using the 1986 version, which only goes up to Sec. 6.7.
>
>>> I could really use a reference that explains
>>> that, so I don't have to rely on a CAS.
>>
>> But Numerical Recipes gives you a reference to Erdelyi et al (1953),
>> which describes how to do this reduction.
>
>I'll look it up next time I'm in the library.
Regarding reduction to canonical forms, here's a link that _might_ be
adequate for your purposes:
http://www.everything2.com/index.pl?node_id=1621468
Both Paul Abbott and David Cantrell have given you the link to an
online version of Numerical Recipes (and section 6.11) here:
http://www.library.cornell.edu/nr/bookcpdf.html
The material there doesn't cover the details of the "classic" methods
of reduction. For that, the following may be of interest:
(1) Numerical Recipes cites Erdelyi's "Higher Transcendental
Functions". That might be overkill (with much unrelated material).
That said, according to amazon.com, Dover Publications is going to
make this work available (in three volumes) around June, 2006. Check
Amazon for details.
(2) "Elliptic Integrals" by Harris Hancock
This small book (104 pages) was first published in 1917. Dover
published a paperback edition in 1958. I believe the Dover edition is
out of print, but it's not too hard to get used.
(3) The "big brother" to (2) is "Lectures on the Theory of Elliptic
Functions" (Dover Phoenix Editions), by Harris Hancock, which is in
print [ISBN 0486438252]. You can check this out at Amazon or at
http://www.doverpublications.com/
Back to Numerical Recipes, you'll also see that it cites several
papers by B.C. Carlson. Carlson's work provides "new definitions"
of the elliptic integrals and related methods for their numerical
computation, among other things.
HTH
Numerical recipes was *very* useful, providing both Carlson's new
definition, plus a verbal algebraic motivation for it. Unfortunately,
it looks like, in order to work all the steps to make Legendre's forms
into Carlson's, it looks like I'd have to factor a quartic. I'm not
prepared to do that, but fortunately I do have very expedient Plan B.
I was looking at the Dover's current book on ellipticals, and found that
it also has a lot of other information that I didn't need. Of course,
Hancock's Dover book from won't contain Carlson's method, because
Carlson published in 1986.
I'll see if I can find his new book in my local public library, to see
if he used Carlson's new result, and whether he's found a way around the
problem of factoring the quartic.
My plan B is to just take the results of Wolfram's symbolic integrator
and stick them in my paper. So congratulate me guys, because (unless I
find a mistake) I've just earned my first publication, and I believe
that it is an important one. I hope this will be enough to salvage my
career.
Congratulations! But by all means do not "just take the results of
Wolfram's symbolic integrator and stick them" in your paper!! There's a
very good chance that some of them could be wrong. I say that based on
personal experience using previous versions of Mathematica to calculate
various elliptic integrals. It may be that the current version is flawless
in this regard, but you should not assume so.
David
>John Schutkeker <jschu...@sbcglobal.net.nospam> wrote:
>[snip]
>> My plan B is to just take the results of Wolfram's symbolic integrator
>> and stick them in my paper.
>
>Congratulations! But by all means do not "just take the results of
>Wolfram's symbolic integrator and stick them" in your paper!! There's a
>very good chance that some of them could be wrong. I say that based on
>personal experience using previous versions of Mathematica to calculate
>various elliptic integrals. It may be that the current version is flawless
>in this regard, but you should not assume so.
>
>David
[snip]
Sage advice.
Also, David, I'm sure that I (and perhaps the OP?) do not fully
understand the ways in which Mathematica's "assumptions", based on the
form of the integrals and the nature of the roots of the polynomials,
affect the output.
I assume this is an even bigger issue when using the "freebie"
integrator.
I know that you have substantial experience with the matters under
discussion here, so I would be very interested in any general comments
you might care to make.
Nor do I.
> I assume this is an even bigger issue when using the "freebie"
> integrator.
I don't think so. The free Integrator should give the same result as
Mathematica. Their site says
"The Integrator uses webMathematica technology to bring the computational
capabilities of Mathematica to the web. The heart of The Integrator is
Mathematica's built-in Integrate function--the same one you use when
accessing Mathematica directly. When you type in an integral, The
Integrator uses webMathematica to send the integral to the Mathematica
kernel, which computes the result using the Integrate function. The result
is then embedded into the web page as typeset output."
> I know that you have substantial experience with the matters under
> discussion here, so I would be very interested in any general comments
> you might care to make.
Well, here's one little suggestion.
If you're getting an antiderivative from a CAS which you think might be
incorrect:
Use that antiderivative with the Fundamental Theorem to compute several
definite integrals, and then compare those values with results obtained by
numerical integration.
David
[snip]
>> Also, David, I'm sure that I (and perhaps the OP?) do not fully
>> understand the ways in which Mathematica's "assumptions", based on the
>> form of the integrals and the nature of the roots of the polynomials,
>> affect the output.
>
>Nor do I.
>
>> I assume this is an even bigger issue when using the "freebie"
>> integrator.
>
>I don't think so. The free Integrator should give the same result as
>Mathematica. Their site says
[snip]
Not worded at all well on my part. What I had in mind was that when
using the Mathematica product, one can specify limits of integration
and 'Assumptions' regarding parameters, but generally cannot with the
free web integrator.
For example, what can Mathematica do with:
Int[y..c] dt / Sqrt[ (a-t) (b-t) (c-t) ], a > b > c > y
I got (by hand)
[ 2 / sqrt(a-c) ] F(phi, k),
phi = arcsin( sqrt[(c-y) / (b-y)] ) k^2 = (a-b) / (a-c)
As an aside, I did discover that one can feed the free web integrator
stuff like (simple example)
Integrate[t^2, {t, a, b}]
and ignore the factor 'x' introduced by the forced 'dx'.