# Computer convolution of sech squared function

I try to compute the analytic form of the convolution of $\operatorname{sech}$ squares function. Mathematica takes so much time to try and find the answer. Here is my code:

Simplify[Convolve[A*Sech[1.7627*x/\[Sigma]]^2, A*Sech[1.7627*x/\[Sigma]]^2, x, y]]


## 1 Answer

Convolve[A Sech[α x/σ]^2, A Sech[α x/σ]^2, x, y, Assumptions -> {α, σ} \[Element] Reals]


(4 A^2 (-σ + y α Coth[(y α)/σ]) Csch[(y α)/σ]^2)/α

This took 500s to run on my system.

• Since only the ratio \[Alpha]/\[Sigma] appears, you can significantly speed up the calculation by replacing the ratio with a single variable and then returning the ratio. – Bob Hanlon Apr 4 '17 at 16:37
• Indeed, and I did that initially and you are right that it speeds it up significantly. I also wanted to show the outcome explicitly but perhaps demonstrating the more intelligent approach would have been... more intelligent! – Quantum_Oli Apr 4 '17 at 16:47
• To do both: Module[{a, expr}, expr = A Sech[α x/σ]^2 /. α -> a*σ; Assuming[{a \[Element] Reals}, Simplify[ Convolve[expr, expr, x, y] /. a -> α/σ]]] // AbsoluteTiming – Bob Hanlon Apr 4 '17 at 17:00
• Ahh. i didn't know mathematica would also try for complex number, no wonder it is so difficult for it to run. – el psy Congroo Apr 10 '17 at 4:45