       Re: NIntegrate that upper limit is infinite

• To: mathgroup at smc.vnet.net
• Subject: [mg71876] Re: NIntegrate that upper limit is infinite
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sat, 2 Dec 2006 05:10:43 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK
• References: <ekp4q1\$2h9\$1@smc.vnet.net>

```Evanescence wrote:
> Dear all:
> My question is as follows:
> First I definite a function that is:
> G[a_]=((-(a-Cos[0.5])^(-3/2))/(3*(10)^2))*(Sin[0.5])^(2)+(1/1-0.1*0.1)*(-(0.005*(1+Cos[0.5])+0.001/1000)*(1+Cos[0.5])^(1/2)*(ArcTan[(a-Cos[0.5])^(1/2)/-(1+Cos[0.5])^(1/2)]-Pi/2)+(0.005*(1-Cos[0.5])-0.001/1000)*(1-Cos[0.5])^(1/2)*(-ArcTanh[(1-Cos[0.5])^(1/2)/(a-Cos[0.5])^(1/2)])
-------^ 
--------------------------------------------------------------------------------------------^

 SetDelayed, that is :=, for function definition is better.
 Missing parenthesis

So, the correct expression is

G[a_] := (-(a - Cos[0.5])^(-3/2)/(3*10^2))*Sin[0.5]^2 + (1/1 -
0.1*0.1)*(-(0.005*(1 + Cos[0.5]) + 0.001/1000))*(1 +
Cos[0.5])^(1/2)*(ArcTan[(a - Cos[0.5])^(1/2)/(-(1 + Cos[0.5])^(1/2))] -
Pi/2) + (0.005*(1 - Cos[0.5]) - 0.001/1000)*(1 -
Cos[0.5])^(1/2)*(-ArcTanh[(1 - Cos[0.5])^(1/2)/(a - Cos[0.5])^(1/2)])

> another function is:
> P[a_]=Re[N[LegendreP[(-1/2)+i,a]]]       where i =(-1)^(1/2)
-------^  -----------------^ 
 SetDelayed, that is :=, for function definition is better.
 Sqrt[-1] is written capital I in Mathematica.

Therefore, the correct expression is

P[a_] := Re[N[LegendreP[-2^(-1) + I, a]]]

> then
> NIntegrate[G[a]*P[a],{a,1,infinite}]
----------------------------^^^^^^^^ 
 Positive infinity is written Infinity in Mathematica.

Hence, the correct expression is

NIntegrate[G[a]*P[a], {a, 1, Infinity}]

> but get the error message
----------^^^
Which one did you get? There are dozens of possible messages...

Regards,
Jean-Marc

```

• Prev by Date: Re: Ask Mathematica to sub for a long expression
• Next by Date: Re: Is mathematica able to transform formula
• Previous by thread: Re: NIntegrate that upper limit is infinite
• Next by thread: Re: NIntegrate that upper limit is infinite