MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: integral inside an integral

  • To: mathgroup at
  • Subject: [mg113615] Re: integral inside an integral
  • From: Leonid Shifrin <lshifr at>
  • Date: Thu, 4 Nov 2010 04:02:25 -0500 (EST)

Hi Charles,

Not as easy as your code suggests, but something like this is possible. You
have to make the
parameter <alpha> numerical, and also define an auxiliary function to do the
integration over y
(at least, I could not see any other way to do this):

h[f_, g_, alpha_?NumericQ] :=
 Module[{k, gint},
  k[x_] := 1/(x^6 + 1);
  gint[x_?NumericQ] :=
   NIntegrate[g[alpha - x - y]*k[y], {y, -Infinity, Infinity}];
  NIntegrate[f[alpha - x]*k[x]/gint[x], {x, -Infinity, Infinity}]]

Example (I hard-coded the k[x_] function for the sake of this example, since
you mentioned
that it is fixed):

In[18]:= h[Abs, #^2 &, 1]

Out[18]= 0.543665


On Wed, Nov 3, 2010 at 10:56 AM, Hagwood, Charles R. <
charles.hagwood at> wrote:

> Does anyone know how to  make the following work using pure functions in
> Mathematica?   Given two functions f and g compute and for a fixed k[x]
> h[f_,g_,alpha]:=NIntegrate[f[alpha-x]*k[x]/NIntegrate[g[alpha-x-y]*k[y],{y,-Infinity,Infinity}],{x,-Infinity,Infinity}]
> I want to put arbitrary  functions f and g into h and get an answer.
> Charles

  • Prev by Date: Re: integral inside an integral
  • Next by Date: Re: Positive amd PositiveDefiniteQ
  • Previous by thread: Re: integral inside an integral
  • Next by thread: Beginner question about Mathematica FinancialData