MathGroup Archive 2003

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

Search the Archive

Re: Function-type arguments in function definition

  • To: mathgroup at
  • Subject: [mg44356] Re: Function-type arguments in function definition
  • From: poujadej at (Jean-Claude Poujade)
  • Date: Wed, 5 Nov 2003 10:02:32 -0500 (EST)
  • References: <bo7o3k$aep$>
  • Sender: owner-wri-mathgroup at

"Carsten Reckord" <news at> wrote in message news:<bo7o3k$aep$1 at>...
> Hi,
> I'm pretty new to Mathematica so please excuse me if this is kind of a silly
> question (though I couldn't find any answer after a full day of searching).
> I'm trying to define functions that take other functions as arguments and
> need those functions' arguments in their own definition. An example would be
> the definition of convolution:
> h(x)=f(x)*g(x) is defined as Integral over f(y)g(x-y) with respect to y.
> As you can see it is important in the definition of convolution to treat the
> arguments f and g as functions because the definition makes use of their
> arguments.
> I've seen this done in Mathematica as
> convolute[f_,g_,x_]:=Integrate[f[y]*g[x-y],{y,-inf,inf}]
> but that's not exactly what I'm looking for because I can only use function
> names as arguments to convolute[...], not arbitrary expressions in x. So I
> can't for example use it for the convolution f(s(x))*g(t(x)) without
> defining intermediate functions for f(s(x)) and g(t(x))...
> So, my question is if there is any way to define such a function that can
> make use of its arguments being functions and yet supports arbitrary
> expressions as its arguments?
> Thanks,
> Carsten
If f and g are expressions, instead of functions,
one needs an extra argument telling the name
of the variable used in f and g (it's not necessarily 'x').
Example : 


(* 'u' is the variable used in expressions f and g *)
Integrate[(f /. u -> y)*(g /. u ->(x-y)),{y,-Infinity,Infinity}];




  • Prev by Date: Re: Solving a matrix equation
  • Next by Date: Re: Re: Integrate 5.0
  • Previous by thread: Re: Function-type arguments in function definition
  • Next by thread: Re: Function-type arguments in function definition