Re: The integrand has evaluated to non-numerical values for all
- To: mathgroup at smc.vnet.net
- Subject: [mg83874] Re: The integrand has evaluated to non-numerical values for all
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 3 Dec 2007 05:46:57 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <fitstp$69s$1@smc.vnet.net>
Kreig Hucson wrote:
> Being given the function:
>
> f[x_,y_]:= Sin[x*y]*Exp[-(y-1)^2]/(x*y) ,
>
> I want to integrate it with respect to y, from 0 to Infinity, and to obtain a function of x only, F[x].
>
> I typed the command:
>
> F[x_]:= Assuming[x>0, Integrate[f[x,y],{y,0,Infinity}]]
>
> but the integral remained unevaluated by Mathematica 6.
>
> After this, I typed the command:
>
> F[x_]:= Assuming[x>0, NIntegrate[f[x,y],{y,0,Infinity}]]
>
> but I received the error message: "The integrand f[x,y] has evaluated to non-numerical values for all sampling points in the region with boundaries {{Infinity,0.}}".
> I looked at the explanations of the error message and there it was suggested to give a particular value to x and to compute the integral for that particular value. I gived one particular value and I obtained the expected result. Anyway I need to obtain an analytical expression for all x>0.
>
> My question is, how can be performed the integral and to obtain the analytical function F[x]?
You could change the form of the original expression to be written as
exponentials only, then do the integration. For instance,
In[1]:= expr = Sin[x*y]*Exp[-(y - 1)^2]/(x*y)
Out[1]=
Sin[x y]
----------------
2
(-1 + y)
E (x y)
In[2]:= f = TrigToExp@expr
Out[2]=
2 2
-(-1 + y) - I x y -(-1 + y) + I x y
I E I E
--------------------- - ---------------------
2 x y 2 x y
In[3]:= F[x_] = Assuming[x > 0, Integrate[f, {y, 0, Infinity}]]
Out[3]=
1 3
--------------- ((-2 - I x) (2 I + x)
2
24 E x (4 + x )
5 1 2
HypergeometricPFQ[{1, 1}, {2, -}, -(-) (-2 I + x) ] +
2 4
2
x /2 3
(E (-2 + I x) (-2 I + x)
5 1 2
HypergeometricPFQ[{1, 1}, {2, -}, -(-) (2 I + x) ] -
2 4
2
1 - I x + x /4 I x
6 (2 E Sqrt[Pi] (-2 I + x) Erf[1 - ---] +
2
2
2 + 1/4 (2 I + x) I x
2 E Sqrt[Pi] (2 I + x) Erf[1 + ---] +
2
2
x /2 2 I x I x
I E (4 + x ) (Pi Erfi[1 - ---] - Pi Erfi[1 + ---] -
2 2
2
2 Log[-2 - I x] + 2 Log[-2 + I x] + Log[-(-2 I + x) ] -
2
2 x /2
Log[-(2 I + x) ]))) / E )
In[4]:= F[2]
Out[4]=
1 5
----- (64 HypergeometricPFQ[{1, 1}, {2, -}, 2 I] +
384 E 2
1 2 5
-- (64 E HypergeometricPFQ[{1, 1}, {2, -}, -2 I] -
2 2
E
2 - 2 I
6 ((4 - 4 I) E Sqrt[Pi] Erf[1 - I] +
2 + 2 I
(4 + 4 I) E Sqrt[Pi] Erf[1 + I] +
2
8 I E (I Pi + Pi Erfi[1 - I] - Pi Erfi[1 + I] -
2 Log[-2 - 2 I] + 2 Log[-2 + 2 I]))))
In[5]:= % // N // Chop
Out[5]= 0.453078
Regards,
--
Jean-Marc