Prove inequality $\tan \left( \frac\pi2 \frac{(1+x)^2}{3+x^2}\right) \tan \left( \frac\pi2 \frac{(1-x)^2}{3+x^2}\right)\le\frac13 $ How to determine the range of the function
$$f(x)=\tan \left( \frac\pi2 \frac{(1+x)^2}{3+x^2}\right)
\tan \left( \frac\pi2 \frac{(1-x)^2}{3+x^2}\right)
$$
It it is straightforward to verify that $f(x)$ is even and
$$f(0)= \frac13, \>\>\>\>\> \lim_{x\to\pm \infty} f(x) \to -\infty$$
which implies $f(x) \in (-\infty,\frac13]$, i.e.
$$\tan \left( \frac\pi2 \frac{(1+x)^2}{3+x^2}\right)
\tan \left( \frac\pi2 \frac{(1-x)^2}{3+x^2}\right)\le \frac13
$$
and is visually confirmed below

However, it is not obvious algebraically that $f(x)$ monotonically decreases away from $x=0$. The standard derivative tests are not viable due to their rather complicated functional forms.
So, the question is how to prove the inequality  $f(x) \le \frac13$ with rigor.
Note that it is equivalent to proving
$$\cot \left(\frac{\pi(1+x)}{3+x^2}\right)
\cot \left(\frac{\pi(1-x)}{3+x^2}\right)\le \frac13
$$

The problem is not too hard if you consider
$$f(x)=\tan (A(x))\,\tan (B(x))$$ Using logarithmic differentiation
$$\frac{f'(x)}{f(x)}=A'(x) \csc (A(x)) \sec (A(x))+B'(x) \csc (B(x)) \sec (B(x))$$
This gives $f'(0)=0$.
Repeating the process knowing that $f(0)=\frac 13$ and $f'(0)=0$ (this simplifies a lot the calculations), we have
$$f''(0)=\frac{16}{81} \left(\sqrt{3}-\pi \right) \pi <0$$ So, by the second derivative test $x=0$ corresponds to the maximum of the function.
We could also have composed Taylor series around $x=0$ to obtain
$$f(x)=\frac{1}{3}+\frac{8}{81} \left(\sqrt{3}-\pi \right) \pi  x^2+\frac{8 \pi 
   \left(\pi  \left(27+2 \sqrt{3} \pi -3 \pi ^2\right)-9 \sqrt{3}\right)
   }{2187}x^4+O\left(x^6\right)$$ which a perfect approximation of the function for $-\frac 12 \leq x \leq \frac 12$ (maximum error  $< 0.00012$ at the bounds).
