MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: This is nuts: Block[{u = 1}, g3[u]] and Block[{u = 0}, g3[u]] executes but NIntegrate[g3[u], {u, 0, Infinity}] doesn't execute


On 2012.01.13. 11:51, Nasser M. Abbasi wrote:
> On 1/12/2012 3:23 AM, Shravan wrote:
>> Hello All,
>>                This program is not as daunting as it appears to be. I am
>> struggling with an issue related to NIntegration. I think the problem
>> is related to syntax but I am not sure. I am having tough time
>> executing the following commands in mathematica.
>>
>> z1 = NIntegrate[g3[u], {u, 0, Infinity}]
>>
>
> Are you sure you really want to do numerical integration from zero to infinity?
>
> This is numerical integration?
>

Hi Nasser,

Just a note that there are several methods for handling situations like
this and Mathematica does support it:

In[24]:= f[x_?NumericQ] := 1/x^2 (* make sure symbolic integration won't
happen *)

In[25]:= NIntegrate[f[x], {x, 1, \[Infinity]}]

Out[25]= 1.

You can try to see what happens with f[x_?NumericQ] := 1/x which doesn't
converge.


--
Szabolcs Horv=E1t
Mma QA site proposal: http://area51.stackexchange.com/proposals/37304



  • Prev by Date: Cross reference
  • Next by Date: Fourier Transform
  • Previous by thread: This is nuts: Block[{u = 1}, g3[u]] and Block[{u = 0}, g3[u]] executes but NIntegrate[g3[u], {u, 0, Infinity}] doesn't execute
  • Next by thread: Matrix typesetting question