|
|
last edited 10 years ago by test1 |
1 2 3 4 | ||
Editor:
Time: 2007/11/17 22:06:46 GMT-8 |
||
Note: Integrate |
changed: - Axiom doesn't seem to do the integral of sin(x^2), but both Maxima and Mathematica (per http://integrals.wolfram.com/ anyway) produce answers. Confirmed by Martin Rubey, and uploaded at his request to IssueTracker. CY \begin{axiom} integrate(sin(x**2),x) \end{axiom} However:: Maxima 5.9.1.1cvs http://maxima.sourceforge.net Using Lisp CMU Common Lisp 19b (19B) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. (%i1) integrate(sin(x**2),x); (sqrt(2) %i + sqrt(2)) x (%o1) sqrt(%pi) ((sqrt(2) %i + sqrt(2)) erf(------------------------) 2 (sqrt(2) %i - sqrt(2)) x + (sqrt(2) %i - sqrt(2)) erf(------------------------))/8 2 (%i2) From BobMcElrath Fri Aug 19 11:13:26 -0500 2005 From: Bob McElrath Date: Fri, 19 Aug 2005 11:13:26 -0500 Subject: (new) Message-ID: <20050819161329.GB28462@mcelrath.org> In-Reply-To: <20050819060559-0500@www.axiom-developer.org> It's worth noting that both Maple and Mathematica produce the FresnelS function, which is *defined* in terms of this integral. However, the Maxima answer appears to be correct as well. From kratt6 Sat Aug 20 09:40:27 -0500 2005 From: kratt6 Date: Sat, 20 Aug 2005 09:40:27 -0500 Subject: Message-ID: <20050820094027-0500@page.axiom-developer.org> Note that $sin(x^2)$ is a D-finite function: \begin{axiom} f := sin(x^2) 4*x^3*f - D(f,x) + x*D(f,x,2) \end{axiom} Thus integration should be "easy"... From kratt6 Sat Aug 20 11:05:33 -0500 2005 From: kratt6 Date: Sat, 20 Aug 2005 11:05:33 -0500 Subject: Message-ID: <20050820110533-0500@page.axiom-developer.org> I browsed the web a little more and came to the conclusion that the Risch algorithm only deals with elementary functions whose integral is elementary, too. "Clearly" (looking at maxima's output or browsing the web), $sin(x^2)$ does not have an elementary antiderivative. Hence, I suspect that it should be treated just as $e^{-x^2}$, by the 'PatternMatchIntegration' package. This would not be too difficult, probably. Martin From kratt6 Sat Aug 20 12:30:16 -0500 2005 From: kratt6 Date: Sat, 20 Aug 2005 12:30:16 -0500 Subject: Message-ID: <20050820123016-0500@page.axiom-developer.org> Although this does not really solve the original problem, I think I found a bug in 'INTPM'. Currently, there is an operation:: pmComplexintegrate(f, x) == (rc := splitConstant(f, x)).const ^= 1 => (u := pmintegrate(rc.nconst, x)) case "failed" => "failed" rec := u::ANS [rc.const * rec.special, rc.const * rec.integrand] cse := (rec := matcherfei(f, x, true)).which cse = ERF => [rec.coeff * erf(rec.exponent), 0] "failed" It is pretty obvious that the third line should read:: (u := pmComplexintegrate(rc.nconst, x)) case "failed" => "failed" instead. If we perform this change, we get instead of \begin{axiom} complexIntegrate(-%i/2*e^(%i*x^2),x) \end{axiom} the correct answer, same for \begin{axiom} complexIntegrate(%i/2*e^(-%i*x^2),x) \end{axiom} For some reason, it still won't do \begin{axiom} complexIntegrate(sin(x^2),x) \end{axiom} Curiously, the pattern matcher is not even invoked in this case... Even if we enter the integral as \begin{axiom} complexIntegrate(-%i/2*e^(%i*x^2)+%i/2*e^(-%i*x^2),x) \end{axiom} it fails, although in this case the pattern matcher is invoked. It would need to be invoked on each summand seperately, though. Martin From kratt6 Sat Aug 20 15:56:51 -0500 2005 From: kratt6 Date: Sat, 20 Aug 2005 15:56:51 -0500 Subject: Message-ID: <20050820155651-0500@page.axiom-developer.org> There is another issue I don't quite understand. Currently axiom returns the whole integral unevaluated if it does not manage to evaluate it completely. If it were not for the bug #199, the following were an example: \begin{axiom} integrate(exp(x)/x+exp(-x^2)+1/log(x),x) \end{axiom} Although axiom produces the intermediate result 'integrate(exp(x)/x+exp(-x^2),x)+li(x)', it discards it. The responsible line of code is in 'rinteg$FSINT' :: rinteg(i, f, x, h, comp) == not elem? i => integral(f, x)$F empty? rest(l := [mkPrimh(f, x, h, comp) for f in expand i]) => first l l Does this make sense? Martin
Axiom doesn't seem to do the integral of sin(x^2), but both Maxima and Mathematica (per http://integrals.wolfram.com/ anyway) produce answers. Confirmed by Martin Rubey, and uploaded at his request to IssueTracker?.
CY
axiomintegrate(sin(x**2),x)
![]() | (1) |
However:
Maxima 5.9.1.1cvs http://maxima.sourceforge.net Using Lisp CMU Common Lisp 19b (19B) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. (%i1) integrate(sin(x**2),x); (sqrt(2) %i + sqrt(2)) x (%o1) sqrt(%pi) ((sqrt(2) %i + sqrt(2)) erf(------------------------) 2 (sqrt(2) %i - sqrt(2)) x + (sqrt(2) %i - sqrt(2)) erf(------------------------))/8 2 (%i2)
axiomf := sin(x^2)
![]() | (2) |
axiom4*x^3*f - D(f,x) + x*D(f,x,2)
![]() | (3) |
Thus integration should be "easy"...
I browsed the web a little more and came to the conclusion that the Risch algorithm only deals with elementary functions whose integral is elementary, too. "Clearly" (looking at maxima's output or browsing the web),PatternMatchIntegration
package. This would not be too difficult, probably.
Martin
Although this does not really solve the original problem, I think I found a bug inINTPM
. Currently, there is an operation:
pmComplexintegrate(f, x) == (rc := splitConstant(f, x)).const ^= 1 => (u := pmintegrate(rc.nconst, x)) case "failed" => "failed" rec := u::ANS [rc.const * rec.special, rc.const * rec.integrand] cse := (rec := matcherfei(f, x, true)).which cse = ERF => [rec.coeff * erf(rec.exponent), 0] "failed"
It is pretty obvious that the third line should read:
(u := pmComplexintegrate(rc.nconst, x)) case "failed" => "failed"
instead. If we perform this change, we get instead of
axiomcomplexIntegrate(-%i/2*e^(%i*x^2),x)
![]() | (4) |
the correct answer, same for
axiomcomplexIntegrate(%i/2*e^(-%i*x^2),x)
![]() | (5) |
For some reason, it still won't do
axiomcomplexIntegrate(sin(x^2),x)
![]() | (6) |
Curiously, the pattern matcher is not even invoked in this case... Even if we enter the integral as
axiomcomplexIntegrate(-%i/2*e^(%i*x^2)+%i/2*e^(-%i*x^2),x)
![]() | (7) |
it fails, although in this case the pattern matcher is invoked. It would need to be invoked on each summand seperately, though.
Martin
There is another issue I don't quite understand. Currently axiom returns the whole integral unevaluated if it does not manage to evaluate it completely. If it were not for the bug #199, the following were an example:axiomintegrate(exp(x)/x+exp(-x^2)+1/log(x),x)
![]() | (8) |
Although axiom produces the intermediate result integrate(exp(x)/x+exp(-x^2),x)+li(x)
, it discards it. The responsible line of code is in rinteg$FSINT
:
rinteg(i, f, x, h, comp) == not elem? i => integral(f, x)$F empty? rest(l := [mkPrimh(f, x, h, comp) for f in expand i]) => first l l
Does this make sense?
Martin