# Plotting a graph

Could anyone help me with plotting the following graph?

Integrate (-Inf, Inf) (exp(-i*x*t))/((4*pi)((x-1)^2 +25)(exp(-100x) +1))


It's not a code obviously, but I don't need a code, it's simple enough. Mathematica times out when I try to pot this. Is there a way around it? Could anyone try and plot it?

Further info: Plot for t = 0 to 100. And the integration is over x.

• If you have tried already, why not posting the actual code ? – b.gates.you.know.what Nov 3 '13 at 9:52
• Is this a double integral? x from - infinity to + infinity and t from 0 to 100? – Vaggelis_Z Nov 3 '13 at 10:07
• @b.gatessucks Because I wrote it on another computer.. is it really a code? I just wrote this equation and wrote integrate and wrote the intervals -Inf to Inf, but I couldnt put a range for t(dont know how to), so I only put 0,1,2,3.. manually for t. – user10366 Nov 3 '13 at 10:08
• @Vaggelis_Z no it's not a double integral. the integral over x would give a number. I just need that number for different t's. And i need to plot only the real part of the graph. – user10366 Nov 3 '13 at 10:09
• Mathematica already never finishes an evaluation for a single given value of t. You probably should use NIntegrate instead of Integrate. Note that the result is complex, and cannot be plotted as is. You need Abs or Re, depending on your needs. – Sjoerd C. de Vries Nov 3 '13 at 10:17

## 1 Answer

Your data/function generates complex value. So I plotted the Re part only. It was hard to read your code, so check that I translated it ok to Mathematica.

f[t_?NumericQ] :=
Quiet@NIntegrate[
Exp[-I*x*t]/((4*Pi) ((x - 1)^2 + 25) (Exp[-100 x] + 1)) , {x, -Infinity,Infinity}];
data = Table[{t, f[t]}, {t, 0, 100, .5}];
ListLinePlot[Re@data, Frame -> True,FrameLabel -> {{"f(t)", None},
{t, "Plot of function"}}] To change PlotRange, see options. If you do not give PlotRange, Mathematica decides on one. So do like this:

ListLinePlot[Re@data, Frame -> True,
FrameLabel -> {{"f(t)", None}, {t, "Plot of function"}},
PlotRange -> {Automatic, {-10^-5, 10^-5}}] Or use All

ListLinePlot[Re@data, Frame -> True,
FrameLabel -> {{"f(t)", None}, {t, "Plot of function"}},
PlotRange -> All]

• Thank you. could you say how I could see this for a larger range of f(t)? – user10366 Nov 3 '13 at 10:19
• @user10366, just play with the PlotRange. Either use All, or give specific plot range. Will add small example. See help for syntax if not sure how. Notice, I used Frame->True, so plot range syntax is a little different. – Nasser Nov 3 '13 at 10:21