Some oscillating function is given. How can I obtain its envelope? For example, for $ \sin x$ I should get $\pm 1$.


Particularly, I am interested in envelope for $$\begin{equation}\frac{(1-x \cot (2 \kappa a x))^{2}}{\left(1-x \cot (2 \kappa a x)-x^{2} / 2\right)^{2}+x^{2}(1-(x / 2) \cot (2 \kappa a x))^{2}}\end{equation}$$


UPD
by envelope I mean line which lies over maximum of function, for instance
[this](https://i.stack.imgur.com/HnADl.png)



How to obtain envelope equation for oscillating functon?
The maxima are at the poles of the cotangent, so for an envelope just retain only the cotangents
$$\frac{(1-x \cot (2 \kappa a x))^{2}}{\left(1-x \cot (2 \kappa a x)-x^{2} / 2\right)^{2}+x^{2}(1-(x / 2) \cot (2 \kappa a x))^{2}}\mapsto
\frac{(x \cot (2 \kappa a x))^{2}}{\left(x \cot (2 \kappa a x)\right)^{2}+x^{2}((x / 2) \cot (2 \kappa a x))^{2}}=\frac{1}{1+x^2/4}.$$


Here is a comparison for $\kappa a=1$.


![](https://ilorentz.org/beenakker/MO/envelop.png)


