convolution of triangle function and sine I am interested in the convolution of a triangle function of width 2d with a cosine function (it has a useful analogy with a physics problem).
I think I should be able to break the problem down using the following:


*

*triangle function of width $2d$ is two convolved box-cars of width $d$

*a box-car is two Heaviside functions (one positive, one negative... I think)

*derivative of Heaviside function H: $\partial H = \delta$

*for any convolution $\partial f * g = f*\partial g$

*$\partial (f*g) = \partial f *\partial g$ (I think)

*$\delta*-\delta = 0$ (I think)


The general idea is to convert a triangle function into an equivalent set of convolved Heaviside functions with some offsets, then take the derivative and convolve a bunch of dirac delta functions with the sinusoid.
Therefore, for triangle function $T$, box-cars $B$:
$T(x)*\cos = T(x)*\partial(\sin(x))\\
= (B(x-d/2)*B(x+d/2))*\partial(\sin)\\
= ((H(x-d)-H(x))*(H(x)-H(x+d)))*\partial(\sin)\\
= \partial\big[(H(x-d)-H(x))*(H(x)-H(x+d))\big]*\sin\\
= \big[(\delta(x-d)-\delta(x))*(\delta(x)-\delta(x+d))\big]*\sin\\
= 0*\sin(x)$
Clearly, that is hilariously wrong. This convolution does not generally self-cancel.
I'm sure there is a nice analytical expression here, but I am not sure how to proceed.
PS. For future readers, the flaw is using $\partial (f*g) = \partial f *\partial g$.  Differentiation is not distributive across convolution.  Error thus propagates from line 4.

There are a couple of mistakes in your derivation. First, if $$B(x-d/2)=H(x)-H(x-d),$$ then $$B(x+d/2)=H(x+d)-H(x).$$ Second, $\partial(f*g)=\partial(f)*g$. On the other hand, in the second last step, you used $\partial(f*g) = \partial(f)*\partial(g)$. Correcting them might help.
