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)]) -------^ [1] --------------------------------------------------------------------------------------------^ [2] [1] SetDelayed, that is :=, for function definition is better. [2] 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) -------^ [3] -----------------^ [4] [3] SetDelayed, that is :=, for function definition is better. [4] 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}] ----------------------------^^^^^^^^ [5] [5] 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