Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7809

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

From Szabolcs Horvát <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject 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
Date 2012-01-14 07:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jerc5k$15o$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

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 Szabolcs Horvát <szhorvat@gmail.com> - 2012-01-14 07:51 +0000

csiph-web