I use version 11.2. enter image description here

Convsum[f_, g_, k_] := 
 Sum[Function[k, f][i] Function[k, g][
    k - i], {i, -\[Infinity], \[Infinity]}]
F[k_] := a^k UnitStep[k]
G[k_] := b^k UnitStep[k]
Convsum[F[k], G[k], k];
Simplify[PowerExpand[%], Element[{k}, Integers]]

When b=2, enter image description here


  • $\begingroup$ Please don't use the bugs tag; it is reserved for things that have been vetted by the community as an actual bug (as explained in the bugs tag wiki). Can you please explain more in your post about why you think this is in error? $\endgroup$ – march Jan 11 '18 at 4:54
  • $\begingroup$ Please forgive me for asking the question for the first time. $\endgroup$ – yonghui wang Jan 12 '18 at 12:58

When using 2 instead of b, Mathematica can use the fact that 2>0. So, you can get the simplification you want by adding the assumption b>0:

sum = Assuming[
    k ∈ Integers && b>0,
    Sum[a^i UnitStep[i] b^(k-i) UnitStep[k-i], {i,-Infinity,Infinity}]
sum //TeXForm

$\begin{cases} \frac{a^{k+1}-b^{k+1}}{a-b} & k\geq 0 \\ 0 & \operatorname{True} \end{cases}$

  • $\begingroup$ Thank you very much. $\endgroup$ – yonghui wang Jan 12 '18 at 12:57

There is also a built-in function for convolution -- you don't need to program it yourself:

f[k_] := a^k UnitStep[k];
g[k_] := b^k UnitStep[k];
DiscreteConvolve[f[k], g[k], k, n]

enter image description here

  • $\begingroup$ Thank you very much. It's a great solution to my problem. $\endgroup$ – yonghui wang Jan 12 '18 at 12:57

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.