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.

  • 3
    $\begingroup$ If you have tried already, why not posting the actual code ? $\endgroup$ – b.gates.you.know.what Nov 3 '13 at 9:52
  • $\begingroup$ Is this a double integral? x from - infinity to + infinity and t from 0 to 100? $\endgroup$ – Vaggelis_Z Nov 3 '13 at 10:07
  • $\begingroup$ @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. $\endgroup$ – user10366 Nov 3 '13 at 10:08
  • $\begingroup$ @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. $\endgroup$ – user10366 Nov 3 '13 at 10:09
  • $\begingroup$ 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. $\endgroup$ – Sjoerd C. de Vries Nov 3 '13 at 10:17

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] := 
   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"}}]

Mathematica graphics

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}}]

Mathematica graphics

Or use All

ListLinePlot[Re@data, Frame -> True, 
 FrameLabel -> {{"f(t)", None}, {t, "Plot of function"}}, 
 PlotRange -> All]
  • $\begingroup$ Thank you. could you say how I could see this for a larger range of f(t)? $\endgroup$ – user10366 Nov 3 '13 at 10:19
  • $\begingroup$ @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. $\endgroup$ – Nasser Nov 3 '13 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.