login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Submitted by : (unknown) at: 2007-11-17T23:01:10-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

integrate((x^2)*(%e^(-x^2)),x=0..%plusInfinity) does not give
sqrt(%pi)/4.

anonymous [mathaction@axiom-developer.org] wrote:
integrate((x^2)*(%e^(-x^2)),x=0..%plusInfinity) does not give sqrt(%pi)/4.

The answer it gives is correct (unless there is a new bug introduced that is not on my axiom 0.20040831-1). The gamma function has sqrt(pi) for half-integer values.

fricas
(1) -> integrate(x^2*(exp(-x^2)), x=0..%plusInfinity)
\begin{equation} \label{eq1}\frac{\sqrt{\pi}}{4}\end{equation}
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
Gamma(3/2)/2::Float
\begin{equation} \label{eq2}{0.5}\ {\Gamma \left({1.5}\right)}\end{equation}
Type: Expression(Float)
fricas
sqrt(%pi)/4::Float
\begin{equation} \label{eq3}0.4431134627 \_ 2637900682\end{equation}
Type: Expression(Float)

What I don't understand is why the integration result is so hard to convert to a Float. Appending ::Float to the integrate() command fails. Why? If I type Gamma(3/2)/2 by hand it has no problem.

Actually the text output is:
          _ 3
         | (-)
            2
   (28)  -----
           2
                    Type: Union(f1: OrderedCompletion Expression Integer,...)

which I assume is the Gamma function, but the tex is converted improperly:

    {{|{\overline {\ }}} 
    \left(
    {{3 \over 2}} 
    \right)}
    \over 2 
    \leqno(29)

i.e. clearly does not contain \Gamma.

{|{\overline {\ } == Gamma? --Bill Page, Thu, 23 Dec 2004 01:32:23 -0600 reply
It is possible to convert this peculiar monogram to \Gamma for display but I think the problem is more fundamental. Clearly AXIOM does not have a consistent and complete representation of the Gamma function. I think integrate should at least return a Gamma that can be converted to Float or something of type Expression Integer like sqrt(%pi)/4. But it seems that the current Gamma function always agressively returns a DoubleFloat? value. This doesn't seem very useful to me for symbolic computations.

{|{\overline {\ } == Gamma? --Bob McElrath?, Thu, 23 Dec 2004 01:42:39 -0600 reply
Bill, What is the type that is returned there? How can I get axiom to print the entire type rather than ...?

I think therein lies the problem. Note that

fricas
integrate(x^2*(exp(-x^2)), x=0..%plusInfinity)::InputForm
\begin{equation} \label{eq4}\left(/ \ {\left(^\ {\left(pi \right)}\ {\left(/ \ 1 \ 2 \right)}\right)}\ 4 \right)\end{equation}
Type: InputForm

seems correct.

P.S. IssueTracker + axiom rules. Having axiom right here is so powerful... I will have to pay more attention to IssueTracker. I was half thinking to strip it when (if) I fork zwiki. Right now IssueTracker is a big hack that can't be uninstalled...

this is not a math bug, only the output is not as nice as it could be --kratt6, Wed, 19 Jan 2005 08:34:21 -0600 reply
Category: Axiom Mathematics => Axiom User Interface Severity: normal => minor

I think this is a math bug! --Bill Page, Wed, 19 Jan 2005 08:54:51 -0600 reply
I disagree. There is something fundamentally wrong here. The result of
fricas
integrate(x^2*(exp(-x^2)), x=0..%plusInfinity)
\begin{equation} \label{eq5}\frac{\sqrt{\pi}}{4}\end{equation}
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

Not only prints oddly without conversion to proper LaTeX but also it is not actually recognized "mathematically" as Gamma().

Further, there is something wrong with the implementation of Gamma() itself because it only works numerically and is of no use symbolically. It seems like there are two separate Gamma functions. The one produced by the integration is "symbolic" but does not seem to be connected to any appropriate logic.

this is not a mathbug, only the output is not as nice as it could be --Bill Page, Wed, 19 Jan 2005 09:20:12 -0600 reply

Category: Axiom Mathematics => Axiom User Interface Severity: normal => minor

:)

This shows where your priorities are Martin! But, thanks.

Some User Interface issue is involved here, but I don't think that it is quite correct to classify it this way. The issue is really what symbollic computations are possible in Axiom involving Gamma? I would say that this is more of a deficiency in the mathmatics.

Name: #6 wrong integration result => #6 integration result Gamma not TeXed correctly

Here is a simple patch:
  diff -c /home/martin/fricas/src/algebra/op.spad.pamphlet\~ /home/martin/fricas/src/algebra/op.spad.pamphlet
  *** /home/martin/fricas/src/algebra/op.spad.pamphlet~ 2007-12-23 18:14:48.000000000 +0100
  --- /home/martin/fricas/src/algebra/op.spad.pamphlet  2007-12-23 19:14:41.000000000 +0100
  ***************
  *** 443,449 ****
        dpi l    == "%pi"::Symbol::O
        dfact x  == postfix("!"::Symbol::O, (ATOM(x)$Lisp => x; paren x))
        dquote l == prefix(quote(first(l)::O), rest l)
  !     dgamma l == prefix(hconcat(super("|"::Symbol::O, "-"::Symbol::O)), l)
        setDummyVar(op, n) == setProperty(op, DUMMYVAR, n pretend None)

        dexp x ==
  --- 443,468 ----
        dpi l    == "%pi"::Symbol::O
        dfact x  == postfix("!"::Symbol::O, (ATOM(x)$Lisp => x; paren x))
        dquote l == prefix(quote(first(l)::O), rest l)
  !     dgamma l == prefix(super("|"::Symbol::O, "-"::Symbol::O), l)
  ! @
  ! 
  ! It is certainly an abuse of [[OutputForm]] to produce a Gamma as done above.
  ! Originally, it was even worse:
  ! \begin{verbatim}
  !     dgamma l == prefix(hconcat("|"::Symbol::O, overbar(" "::Symbol::O)), l)
  ! \end{verbatim}
  ! which was TeXed to
  ! $$
  ! {|{\overline {\ }}} 
  ! \left(
  ! {x} 
  ! \right).
  ! $$
  ! 
  ! The right thing would be to introduce Greek letters in [[OutputForm]], but that
  ! should be coordinated with the new mathml package.
  ! 
  ! <<package COMMONOP CommonOperators>>=
        setDummyVar(op, n) == setProperty(op, DUMMYVAR, n pretend None)

        dexp x ==

Warning: Gamma looks slightly different in ASCII then. A better patch is discussed on the FriCAS list, 23.12.2007

Martin

Status: open => fix proposed

patch attached. Observation by Bill Page transferred to new report #408

fixed in FriCAS

Status: fix proposed => closed

Some or all expressions may not have rendered properly, because Latex returned the following error:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./5003545581181727741-16.0px.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-01-16>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/share/texlive/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/ucs/utf8x.def))
(/usr/share/texlive/texmf-dist/tex/latex/bbm-macros/bbm.sty)
(/usr/share/texlive/texmf-dist/tex/latex/jknapltx/mathrsfs.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/pstricks/pstricks.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/mathcolor.ltx)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def))
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.tex
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.06, 2020/11/20 (hv))
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/pgf.revision.tex)))
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfiltered
.code.tex))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet
ric.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod
e.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison
.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code
.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari
thmetics.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex))
`PSTricks' v3.18  <2022/11/28> (tvz,hv)
--- We are running latex or xelatex ---
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.con)
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks-color.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks-arrows.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks-dots.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.con))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.06, 2020/11/20 (hv)))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/epsfig.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))))
(/usr/share/texlive/texmf-dist/tex/latex/pst-grad/pst-grad.sty
(/usr/share/texlive/texmf-dist/tex/generic/pst-grad/pst-grad.tex
`pst-grad' v1.06, 2006/11/27 (tvz,dg,hv)))
(/usr/share/texlive/texmf-dist/tex/latex/pst-plot/pst-plot.sty
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/pst-xkey.sty)
(/usr/share/texlive/texmf-dist/tex/latex/multido/multido.sty
(/usr/share/texlive/texmf-dist/tex/generic/multido/multido.tex
 v1.42, 2010/05/14 <tvz>))
(/usr/share/texlive/texmf-dist/tex/generic/pst-plot/pst-plot.tex
(/usr/share/texlive/texmf-dist/tex/generic/pst-tools/pst-tools.tex
`PST-tools' v0.12, 2021/09/23 (hv))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
(/usr/share/texlive/texmf-dist/tex/generic/pst-node/pst-node.tex
 v1.43, 2022/01/31)
(/usr/share/texlive/texmf-dist/tex/generic/pst-arrow/pst-arrow.tex
`pst-arrow' v0.05, 2021/11/16 (dr,hv))
(/usr/share/texlive/texmf-dist/tex/generic/pst-3d/pst-3d.tex
`PST-3d' v1.11, 2010/02/14 (tvz))
(/usr/share/texlive/texmf-dist/tex/generic/pst-math/pst-math.tex
`pst-math' v0.66 , (CJ,hv)) `pstricks-add' v3.93, 2022/11/21 (dr,hv))
 v1.94, 2022/11/21 (tvz,hv)))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty)

Package geometry Warning: `lmargin' and `rmargin' result in NEGATIVE (-108.405p t). `width' should be shortened in length.

) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/setspace/setspace.sty) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xy.sty (/usr/share/texlive/texmf-dist/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes, docmode, (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyrecat.tex ) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyidioms.tex)

Xy-pic version 3.8.9 <2013/10/06> Copyright (c) 1991-2013 by Kristoffer H. Rose <krisrose@tug.org> and others Xy-pic is free software: see the User's Guide for details.

Loading kernel: messages; fonts; allocations: state, direction, utility macros; pictures: \xy, positions, objects, decorations; kernel objects: directionals, circles, text; options; algorithms: directions, edges, connections; Xy-pic loaded) (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifpdf.sty)) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyall.tex Xy-pic option: All features v.3.8 (/usr/share/texlive/texmf-dist/tex/generic/xypic/xycurve.tex Xy-pic option: Curve and Spline extension v.3.12 curve, circles, loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyframe.tex Xy-pic option: Frame and Bracket extension v.3.14 loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xycmtip.tex Xy-pic option: Computer Modern tip extension v.3.7 (/usr/share/texlive/texmf-dist/tex/generic/xypic/xytips.tex Xy-pic option: More Tips extension v.3.11 loaded) loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyline.tex Xy-pic option: Line styles extension v.3.10 loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyrotate.tex Xy-pic option: Rotate and Scale extension v.3.8 loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xycolor.tex Xy-pic option: Colour extension v.3.11 loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xymatrix.tex Xy-pic option: Matrix feature v.3.14 loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xyarrow.tex Xy-pic option: Arrow and Path feature v.3.9 path, \ar, loaded) (/usr/share/texlive/texmf-dist/tex/generic/xypic/xygraph.tex Xy-pic option: Graph feature v.3.11 loaded) loaded) (/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphviz/graphviz.sty (/usr/share/texlive/texmf-dist/tex/latex/psfrag/psfrag.sty)) (/usr/share/texmf/tex/latex/sagetex.sty Writing sage input file 5003545581181727741-16.0px.sage ) (/usr/share/texlive/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty (/usr/share/texlive/texmf-dist/tex/latex/moreverb/moreverb.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/generic/catchfile/catchfile.sty (/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty))

Package gnuplottex Warning: Shell escape not enabled. (gnuplottex) You'll need to convert the graphs yourself.

) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def) No file 5003545581181727741-16.0px.aux. (/usr/share/texlive/texmf-dist/tex/latex/ucs/ucsencs.def) geometry driver: auto-detecting geometry detected driver: dvips (/usr/share/texlive/texmf-dist/tex/latex/jknapltx/ursfs.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd)

Package amsmath Warning: Foreign command \over; (amsmath) \frac or \genfrac should be used instead (amsmath) on input line 123.

[1] [2] [3] Missing { inserted. <to be read again> \ l.129 \label{eq4}\left(/ \ {\left(^\ {\left(pi \right)}\ {\left(/ \ 1 \ 2 ...

Missing } inserted. <inserted text> } l.129 ...ight)}\ {\left(/ \ 1 \ 2 \right)}\right )}\ 4 \right)\end{equatio...

[4] [5] [6] [7] (/usr/share/texlive/texmf-dist/tex/latex/base/t1cmtt.fd)

LaTeX Warning: Characters dropped after `\end{verbatim}' on input line 136.

[8] (./5003545581181727741-16.0px.aux)

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

) (see the transcript file for additional information) Output written on 5003545581181727741-16.0px.dvi (8 pages, 3084 bytes). Transcript written on 5003545581181727741-16.0px.log.




  Subject: (replying)   Be Bold !!
  ( 15 subscribers )  
Please rate this page: