In the definition for planch, try changing abs to cabs; thus
planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$
Alternatively, change abs(f)^2 to conjugate(f) * f.
To see what is going on, look at
(%i51) larry : FT(f,x,k);
(%o51) sqrt(%pi)*%e^(-%pi^2*k^2)-2*sqrt(%pi)*%i*%e^(-%pi^2*k^2)*sin(%pi*k)
OK:
(%i52) cabs(larry)^2;
(%o52) 4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2+%pi*%e^(-2*%pi^2*k^2)
OK:
(%i53) expand(conjugate(larry) * larry);
(%o53) 4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2+%pi*%e^(-2*%pi^2*k^2)
Bogus:
(%i54) expand(abs(larry)^2);
(%o54) -4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2-4*%i*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)+%pi*%e^(-2*%pi^2*k^2)
There are readers on this list who understand the whys related to the behavior of abs vs cabs.
And I'm not one of those readers :(
--Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>To:?maxima at math.utexas.edu
>From:?Peter?Dufault?<dufault at hda.com>
>Sent?by:?maxima-bounces at math.utexas.edu
>Date:?05/25/2011?04:32PM
>Subject:?[Maxima]?Help?with?Plancherel's?theorem
>
>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
>
>_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima