[Maxima] plotting a parametric integral

Leo Butler l.butler at ed.ac.uk
Fri Oct 9 11:19:04 CDT 2009

```
On Fri, 9 Oct 2009, Leo Butler wrote:

<
<
< On Fri, 9 Oct 2009, Stanislav Maslovski wrote:
<
< < Hello,
< <
< < I am trying to plot this simple Fourier integral in Maxima 5.17.1:
snip
< (%i2) f(t) ::= buildq([k:t],
< integrate(exp(%i*k*x)*sin(x)/x,x,minf,inf));
< (%o2) f(t)::=buildq([k:t],integrate(exp(%i*k*x)*sin(x)/x,x,minf,inf))
<
< of k) when t is a constant. I have also set ratprint to false to avoid
< the annoying warnings about floats being converted to rationals.
<
< (%i3) l : makelist(i/10,i,-20,20)\$
snip
< Note that you can also use 'assume':
<
< (%i35) [ (map(forget,facts()), assume(k<-1),f(k)) , (forget(k<-1),
< assume(k>1),f(k)) , (forget(k>1), assume(k>-1,k<1),f(k)), f(-1), f(1) ];
< (%o35) [0,0,%pi,0,%pi]

I should say that there are two errors in the output here. f(-1) should
equal f(1) and both should be

(%i19) integrate(cos(x)*sin(x)/x,x,minf,inf);
(%o19) %pi/2

Interestingly, Maple does not give the correct answer for f(-1) or f(1)
either, and Wolfram Alpha times out in doing the integral; both do the
trig integral correctly.