For integer values of $n$, I was trying to calculate the convolution of $t^{-n}$ with itself. So I wrote this:

Table[Convolve[t^-n UnitStep[t], t^-n UnitStep[t], t, x], {n,5}]

which resulted in a sequence of functions whose general form was like this: $$\frac{b_n+c_n\ln{x}}{x^{2n-1}}\text{u}(x)\qquad n=1,2,3,...$$ where $b_n\le0$ and $c_n>0$ are constant values. I couldn't find a pattern in these constants. So I tried to evaluate the general term of convolution in Mathematica. I defined f as:

f[t_,n_]:= Piecewise[{{t^-n, Element[n,Integers] && n>0 && t>0}, {0,True}}]


g[x_,n_]:= Evaluate[Convolve[f[t,n],f[t,n],t,x]]

to get: $$\frac{\text{u}(t)}{t^n}*\frac{\text{u}(t)}{t^n}=\frac{\Gamma(1-n)\sqrt{\pi}}{\Gamma(3/2-n)}\left(\frac 2t\right)^{2n-1}\text{u}(t)$$ But this doesn't add up. For example, if you write

h[t_,n_]:= (2/t)^(2n-1) Sqrt[Pi] Gamma[1-n] / Gamma[3/2-n];
Limit[h[t, n], n -> 1]

It gives the result as $\pm\infty$, which is surely not equal to the convolution of $\frac 1t\text{u}(t)$ with itself. (It was $\frac {2\text{u}(t)}t\ln{t}$ by the way).

So the question is, what am I missing here? Why Mathematica gives two completely different results for two (seemingly) same expressions?

  • The form of the result suggests that the Gauss hypergeometric theorem is being applied improperly here. Let me think about it... – J. M. is computer-less Jan 3 '17 at 8:34
  • 1
    FWIW, FullSimplify[g[x,n]] evaluates to ComplexInfinity symbolically (no need to take the limit of $n\to1$). The reason is that Gamma[1-n]==ComplexInfinity for all integer n. – AccidentalFourierTransform Jan 3 '17 at 12:13
  • @AccidentalFourierTransform This has been answered using the Pareto distribution defined such that the area under the curve is not infinite, see – Carl Mar 11 at 4:50
  • While I agree this looks like a bug based on your cited question,, this community's convention is to wait for a case-report from WRI confirming something's status as a bug before we attach the tag. If you haven't already reported it to them you can do so, attach the case number, and then put the tag back on. – b3m2a1 Mar 11 at 16:46
  • @b3m2a1 I am not familiar with the process. In fact, I have no idea what you meant by case-report from WRI. The post is made over a year ago, but the bug is still there even in the new version. So it looks like nobody cares, and since I am quite busy with other stuff, I think my best course of action is to just leave it be. – polfosol Mar 11 at 16:58

I don't know why Mathematica returns the incorrect result, but it may be helpful to have the correct result so as to find the origin of the bug.

To find the correct result, one may generate the first few convolutions for $n=1,2,\cdots,20$ and then use FindSequenceFunction to get the general formula for arbitrary $n$. The result is

-((4^(-1 + n) x^(1 - 2 n) Gamma[-(1/2) + n] (Log[4] - 2 Log[x] + PolyGamma[0, -(1/2) + n] - PolyGamma[0, n]))/(Sqrt[\[Pi]] Gamma[n]))

which, for $n=1,2,3,\cdots$ evaluates to

(2 Log[x])/x, (-2 + 4 Log[x])/x^3, (-7 + 12 Log[x])/x^5, ...

The Latex formula for arbitrary $n$ reads $$ \frac{4^{n-1} x^{1-2 n} \Gamma \left(n-\frac{1}{2}\right) \left(-\psi ^{(0)}(n)+\psi ^{(0)}\left(n-\frac{1}{2}\right)-2 \log \left(\tfrac12x\right)\right)}{\sqrt{\pi }\ \Gamma (n)} $$

  • That formula of yours can be compacted further: 2 x^(1 - 2 n) Binomial[2 n - 2, n - 1] (HarmonicNumber[n - 1] - HarmonicNumber[2 n - 2] + Log[x]) – J. M. is computer-less Jan 3 '17 at 13:45
  • I made a post about this on MathSE. It turned out the results that I thought were wrong are actually RIGHT! @J.M. – polfosol Jan 4 '17 at 6:25
  • @polfosol indeed, if you evaluate Assuming[x>0,Integrate[t^-1 HeavisideTheta[t](x-t)^-1 HeavisideTheta[x-t],{t,-Infinity, Infinity}]] you get Integrate::idiv: Integral does not converge on {-Infinity,Infinity}. >> which confirms your result that the integral diverges! I agree with you that this is clearly a bug of MM. – AccidentalFourierTransform Jan 4 '17 at 13:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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