I'm trying to get up to speed with Maxima.
Can someone explain why I don't get "0" for %o12?
Here's the input:
====
declare(x,[real,scalar])$
declare(k,[real,scalar])$
/* Gaussian. */
gauss(x):=%e^(-x^2)$
/* Fourier transform. */
FT(fx,x,k):=integrate(fx*%e^(-2 * %i * %pi * k * x), x, minf, inf)$
/* An even function (gaussian) + odd function (two shifted gaussians, one negative): */
feven:gauss(x)$
fodd:gauss(x - 1/2) - gauss(x + 1/2)$
f:feven+fodd$
/* "Plancherel's sum" - just integrate the square of the modulus over all values. */
planch(f,v):=factor(integrate(abs(f)^2,v,minf,inf))$
/* I expect these to all be 0. */
planch(feven,x) - planch(FT(feven,x,k),k); /* OK. */
planch(fodd,x) - planch(FT(fodd,x,k),k); /* OK. */
planch(f,x) - planch(FT(f,x,k),k); /* Huh? */
====
Here's the output:
====
[dufault at flipper cross]$ maxima
Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp SBCL 1.0.40-1.fc14
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) batch("simple.mac")$
read and interpret file: /home/dufault/play/cross/simple.mac
(%i2) declare(x, [real, scalar])
(%i3) declare(k, [real, scalar])
2
- x
(%i4) gauss(x) := %e
- 2 %i %pi k x
(%i5) FT(fx, x, k) := integrate(fx %e , x, minf, inf)
(%i6) feven : gauss(x)
1 1
(%i7) fodd : gauss(x - -) - gauss(- + x)
2 2
(%i8) f : fodd + feven
2
(%i9) planch(f, v) := factor(integrate(abs(f) , v, minf, inf))
(%i10) planch(feven, x) - planch(FT(feven, x, k), k)
(%o10) 0
(%i11) planch(fodd, x) - planch(FT(fodd, x, k), k)
(%o11) 0
(%i12) planch(f, x) - planch(FT(f, x, k), k)
(3 sqrt(%e) - 2) sqrt(%pi) (sqrt(%e) - 2) sqrt(%pi)
(%o12) -------------------------- + ------------------------
sqrt(2) sqrt(%e) sqrt(2) sqrt(%e)
(%i14)
====
Peter
-----------------
Peter Dufault
HD Associates, Inc. Software and System Engineering