Hidden property of the graph of $y=\tan{x}$: infinite product of lengths of zigzag line segments converges, but to what

closed-forminfinite-productlimitssequences-and-seriestrigonometry

On the graph of $y=\tan{x}$, $0<x<\pi/2$, draw $2n$ zigzag line segments that, with the x-axis, form equal-width isosceles triangles whose top vertices lie on the curve. Here is an example with $n=6$.

enter image description here

It seems that, as $n\to\infty$, the product of their lengths converges to a positive number. The limit is:

$$L=\lim\limits_{n\to\infty}\exp{\sum\limits_{k=1}^n}\ln{\left(\left(\frac{\pi}{4n}\right)^2+\tan^2{\left(\frac{2k-1}{4n}\pi\right)}\right)}$$

Desmos suggests that $L\approx 2.50917847$. I am looking for a closed form for this limit.

I've been trying to apply what I learned about sums of logs in a previous question of mine, but I still have not been able to evaluate this one.

If we change the graph to $y=\tan{\left(\frac{\pi}{2}x\right)}$, $0<x<1$, the corresponding limit seems strikingly similar to $\frac{1}{2}\left(e+\frac{1}{e}\right)$, based on computer calculation. So, assuming that is the correct limit in that case, I would expect the limit in this question, $L$, to look something along those lines.

I find it interesting that a geometrical infinite product, that is neither $0$ nor $\infty$, exists in such a simple geometrical construction, without needing to make any modifications.

EDIT: Thanks to @Jean Marie's comment, I am very confident that $L=\cosh{(\pi/2)}$. But how to prove this?

Best Answer

The expression under the limit has a closed form: by factoring $z^{2n}+1$, one gets $$P_n(a,b):=\prod_{k=1}^n\left(a^2-2ab\cos\frac{2k-1}{2n}\pi+b^2\right)=a^{2n}+b^{2n},$$ thus $$\prod_{k=1}^n\left(x^2+\tan^2\frac{2k-1}{4n}\pi\right)=\frac{P_n(1+x,1-x)}{P_n(1,-1)}=\frac12\big((1+x)^{2n}+(1-x)^{2n}\big).$$ Now plug in $x=\pi/(4n)$ and take $n\to\infty$ to get $L=\cosh(\pi/2)$.