I am trying to calculate n-fold convolution of a function as $G^{*n}(x)$ where $G(x)=1-a*exp(-b)+b*ln(b)$.

I tried this function, Convolve[G[x], G[x]^{n - 1}, x, x] but it didn't give any answer. Could you please help me on this matter? Is there any way to calculate n-fold convolution of a function in mathematica?

  • $\begingroup$ have a look at my question mathematica.stackexchange.com/questions/32505/… may be others can know. What I khow is either taking the fourier transform, multiply and transform back, or, calcuate it iteratively as in my question above. $\endgroup$ – Seyhmus Güngören Feb 23 '15 at 14:46
  • $\begingroup$ thanks @seyhmusGüngören, I'm trying it. $\endgroup$ – jenny Feb 23 '15 at 15:04
  • $\begingroup$ What are a and b in G[x]? Also, please display literal Mathematica code in questions whenever possible, like G[x_] := 1 - a Exp[-b] + b Log[b]. Doing so will attract more answers. I suggest you edit your question now. $\endgroup$ – bbgodfrey Feb 23 '15 at 15:17
  • $\begingroup$ Not hearing back from you, I tried G[x_] := 1 - x Exp[-x] + x Log[x] and got no answer too. This was because Mathematica just kept running, burning more and more memory. I aborted it to avoid crashing. The problem probably is the x Log[x] term, which is singular at x = 0. x Exp[-x] probably has a similar problem at negative infinity. $\endgroup$ – bbgodfrey Feb 23 '15 at 16:50

First, Convolve only works when the output variable is different:

Convolve[Exp[x], Exp[-x^2/2], x, x]

won't work, but

Convolve[Exp[x], Exp[-x^2/2], x, y]

does, resulting in

E^(1/2 + y) Sqrt[2 Pi]

Your second problem is that $G(x)$ is not actually dependant on $x$, it is merely a constant. The convolution of two constant functions is infinite or undefined, so it makes sense that Mathematica won't return any output.

A third problem is that your syntax for derivatives is incorrect (assuming by $f^{*n}$ you mean $f^{(n)}$, the $n$-th derivative of $f$). G[x]^(n-1) raises G[x] to the n-1 power.

However, you wrote G[x]^{n-1}; in Mathematica, curly braces ({}) are used to define lists, not to group like in $\TeX$. Since Power threads over lists, the result is {G[x]^(n-1)}, a list with a single element, G[x]^(n-1).

You want to use the derivative function D:

D[G[x], {x, n-1}]

Lastly, you'll need to define G before using it, so that Mathematica knows what you're talking about. The command

G[x_] := 1 - a Exp[-b] + b Log[b]

defines G as your original expression. Note that you'll want to modify it to depend on x for the convolution to make sense!

  • $\begingroup$ Sorry for the delay and thank for all your comment. In the meantime, I have been working on the function G(x). You are right. The latest version of the G(x) function is $G(x)=1-exp(-x)+x(-a-ln(x)+Gamma[0,x]+log(x))$. I need to calculate $G^{∗n}(x)$ where $$G^{*n}(x) = \underbrace{G(x)*G(x)*G(x)* \cdots*G(x)*G(x)}_n,\quad $$ Is it possible in mathametica? $\endgroup$ – jenny Feb 25 '15 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.