I would love to appreciate some tips on a problem I have. I am calculating moments for some functions that do not have analytic solution at all. Therefore NIntegrate should be my friend. But it's not :(
Long story short I would love to integrate something like this in range {-Infinity,+Infinity}
As you see, function converges at both ends. When I try NIntegrate, it gives me pretty impossible results (especially when plot comes near x axis). What would you? Is there some specific method? Some mathematical magic trick I am not aware? Should I chop my function somewhere? (If yes then where?)
Edit: Adding a sample of some function I am trying to valuate expectation value:
Somthing[Z_?NumericQ, G_?NumericQ] :=
NIntegrate[((4 E^(-Z (π + 2 ArcTan[(2 x)/G])) G Z x)/(
G^2 + 4*x^2))/(1 - Exp[-2*π*Z]), {x, -∞, +∞}]
NIntegrate
does takeInfinity
as a limit. Have you tried that? $\endgroup$Z
andG
$\endgroup$