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


Groups > comp.soft-sys.math.mathematica > #7809 > unrolled 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

Started bySzabolcs Horvát <szhorvat@gmail.com>
First post2012-01-14 07:51 +0000
Last post2012-01-14 07:51 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  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

#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

FromSzabolcs Horvát <szhorvat@gmail.com>
Date2012-01-14 07:51 +0000
SubjectRe: 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
Message-ID<jerc5k$15o$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web