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
$$
 A: 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).
A: Note that
$$f(x)=\tan\left(\frac{\pi}{2}\frac{(1+x)^2}{3+x^2}\right)\tan\left(\frac{\pi}{2}\frac{(1-x)^2}{3+x^2}\right)=\frac{2\cos(2\pi/(3+x^2))}{\cos(2\pi x/(3+x^2))-\cos(2\pi/(3+x^2)} +1,$$
which is slightly easier to take the derivative:
$$f'(x)=\frac{8 \pi x \cos(\frac{2 \pi x}{3 + x^2}) \sin(\frac{2 \pi}{3 + x^2}) - 4 \pi (x^2-3) \cos(\frac{2 \pi}{3 + x^2}) \sin(\frac{2 \pi x}{3 + x^2})}{(3 + x^2)^2 \left(\cos(\frac{2 \pi}{3 + x^2}) - \cos(\frac{2 \pi x}{3 + x^2})\right)^2}$$
Obviously the denominator is positive, so we need to show that for $x \geq  0$:
$$8 \pi x \cos\left(\frac{2 \pi x}{3 + x^2}\right) \sin\left(\frac{2 \pi}{3 + x^2}\right) - 4 \pi (x^2-3) \cos\left(\frac{2 \pi}{3 + x^2}\right) \sin\left(\frac{2 \pi x}{3 + x^2}\right) \leq 0.$$
This can be further simplified to
$$-2 \pi \left((x-1)(x+3) \sin\left(\frac{2 \pi(x-1)}{3 + x^2}\right) + (x+1)(x-3) \sin\left(\frac{2 \pi(x+1)}{3 + x^2}\right)\right)\leq 0\tag{1}$$
ant thus we need to show that for $x\geq 0$
$$(x-1)(x+3) \sin\left(\frac{2 \pi(x-1)}{3 + x^2}\right) \geq -(x+1)(x-3) \sin\left(\frac{2 \pi(x+1)}{3 + x^2}\right)$$
It seems we have to split it into intervals (probably two $x\in(0,1)$ and $x\in(1,\infty)$), and investigate the inequalities on the intervals, but I am stuck here at the moment.
UPDATE:
We see that (1) is an odd function, so it sufficient to investigate only one part, e.g. we need to show that for $x\geq 0$,
$$g(x)=(x-1)(x+3)\sin\left(\frac{2\pi(x-1)}{3+x^2}\right)\geq 0$$
We see that for $x\geq 0$, the equation has exacly 2 roots, $x=0$ and $x=1$ and therefore we can look at the sign in the subintervals. For example,plugging $x=0.5$, $g(0.5)=1.44022$ and $g(2)=3.909$. Thus the function $g(x)\geq 0$, and therefore $f(x)$ is non-increasing for $x\geq0$ (and by the oddness of (1), non-decreasing for $x\leq 0$).
If we look at the extrema $x=0$, and $x=1$, we see that $f(0)=\frac{1}{3}$ and $\lim_{x\to 1}f(x)=0$, therefore $f(0)=\frac{1}{3}$ is global maximum.
A: Note: $f(1) \triangleq
\lim_{x\to 1} \tan ( \frac\pi2 \frac{(1+x)^2}{3+x^2})
\tan ( \frac\pi2 \frac{(1-x)^2}{3+x^2}) = 0$.
Since $f(x)$ is even, we only need to prove the case $x \in [0, \infty)$.
Clearly $f(x) < 0$ for all $x > 1$. Also, $f(1) = 0$.
Thus, we only need to prove the case $0\le x < 1$.
(Inspired by @pisoir's 1st equation) Let $A =  \frac\pi2 \frac{(1+x)^2}{3+x^2}, B = \frac\pi2 \frac{(1-x)^2}{3+x^2}$.
Clearly $A, B \in (0, \frac{\pi}{2})$.
It suffices to prove that $\sin A \sin B \le \frac{1}{3}\cos A \cos B$ or
$$\frac{1}{2}[\cos (A - B) - \cos ( A + B)] \le \frac{1}{3}\cdot \frac{1}{2}[\cos (A - B) + \cos (A + B)]$$
or
$$\cos \frac{2\pi x}{x^2 + 3} \le 2 \cos \frac{\pi (x^2 + 1)}{x^2 + 3}. $$
Let $C = \frac{2\pi x}{x^2 + 3}$ and $D = \frac{\pi (x^2 + 1)}{x^2 + 3}$.
We split into two cases:

*

*$\frac{1}{3} \le x < 1$:

Clearly, $\frac{\pi}{3} \le D \le \frac{\pi}{2}$ and $0 \le \frac{\pi}{2} - C \le 2(\frac{\pi}{2} - D) \le \frac{\pi}{2}$. We have
\begin{align}
\cos C &= \sin (\tfrac{\pi}{2} - C) \\
&\le \sin [2(\tfrac{\pi}{2} - D)]\\
&= 2\sin (\tfrac{\pi}{2} - D) \cos (\tfrac{\pi}{2} - D) \\
&\le 2\sin (\tfrac{\pi}{2} - D) \\
&= 2\cos D.
\end{align}


*$0 \le x < \frac{1}{3}$:

We give the following auxiliary results (Facts 1-2). The proofs are easy and thus omitted.
Fact 1: $\cos u \le 1 - \frac{1}{3}u^2$ for all $u$ in $[0, \pi/4]$.
Fact 2: $\cos v \ge \frac{1}{2} - \frac{5}{9}\sqrt{3}\, (v - \tfrac{\pi}{3})$ for all $v \in [\pi/3, \pi/2]$.
Let us proceed. Clearly $C \in [0, \pi/4]$ and $D \in [\pi/3, \pi/2]$.
By Facts 1-2, it suffices to prove that
$$1 - \frac{1}{3}C^2 \le
2\left[\frac{1}{2} - \frac{5}{9}\sqrt{3}\, \left(D - \frac{\pi}{3}\right)
\right]$$
that is
$$\frac{4\pi x^2 [9\pi - 5\sqrt{3}(x^2 + 3)]}{27(x^2 + 3)^2}\ge 0$$
which is true.
We are done.
A: $$g(x)=\frac{(1+x)^2}{3+x^2}=1+2\frac{x-1}{3+x^2}$$
$$\text{$g$ is continuous for all real numbers and has a derivative} \\ \text{therefore we can find the max and min} \\ g'=2\frac{3-x^2+2x}{(3+x^2)^2}; \quad g'=0\Rightarrow (x-3)(x+1)=0 \\ \text{After that it's obvious that the range of $g$ is } [f(-1),f(3)]=[0,\frac{4}{3}] $$
$$\text{At $g(2)=1$ the $\tan$ function inside $f(g)$ for $\frac{\pi}{2}$ isn't defined}$$
$$f(g)=\tan\Big(g(x)\frac{\pi}{2}\Big)\cdot \tan\Big(g(-x)\frac{\pi}{2}\Big)$$
$$g\cdot\frac{\pi}{2} :\mathbb{R} \rightarrow[0,\frac{2}{3}\pi]$$ 
$$\text{And also, at }x\geq0,\;g(x)\cdot \frac{\pi}{2}\in[\frac{\pi}{6},\frac{2}{3}\pi] \\ \hspace{135px} g(-x)\cdot\frac{\pi}{2}\in[0,\frac{\pi}{2})$$
$$\text{And since when both $tan$ parts of the function when $g(x \geq 0)\cdot \frac{\pi}{2}\in (\frac{\pi}{2}, \frac{2}{3}\pi]$} \\ \text{are multiplied, we get a negative result,} \\ \text{Therefore we should check for $\forall x\;\;g(x\geq 0)\cdot \frac{\pi}{2}\in[\frac{\pi}{6}, \frac{\pi}{2})$}$$
$$\text{From here it should be simpler to continue, what you should end up} \\ \text{with is that at $\frac{\pi}{6}$ the $\tan$ functions take their maximal value when} \\ \text{$g(x)\frac{\pi}{2} = \frac{\pi}{6} \;$and multiplied together, the result will be $\frac{1}{3}$}$$
A: Partial answer :
Well we can use Jensen's inequality remarking that :
$$f(x)=\ln\Big(\tan\Big(\frac{\pi}{2}\frac{(1+x)^2}{3+x^2}\Big)\Big)$$
Is concave on $[\frac{-17}{100},\frac{17}{100}]$
So we have :
$$f(x)+f(-x)\leq 2f(0)$$
A bit of algebra and we get the result !
We can improve the reasoning for that we use a substitution:
$$x=\frac{a}{a+1}$$
And follow the same reasoning !
The concavity (an attempt)for $-\frac{17}{100}<x<0$:
We start by introduce a function called $j$ :
$$j(x)=\ln\left(\tan\left(\frac{\left(\frac{x}{x+1}-1\right)^2}{3+\left(\frac{x}{x+1}\right)^2}\right)\right)$$
The derivative is equal to :
$$j'(x)=-\frac{\pi(4x+3)\csc\left(\frac{\pi}{2(4x^2+6x+3)}\right)\sec\left(\frac{\pi}{2(4x^2+6x+3)}\right)}{(4x^2+6x+3)^2}$$
Using the substitution $y=4x^2+6x+3$
The function :
$$h(y)=-\frac{\csc\left(\frac{\pi}{2(y)}\right)\sec\left(\frac{\pi}{2(y)}\right)}{(y)}$$
Is increasing and negative .On the other hand the function :
$$g(x)=\frac{\pi(4x+3)}{(4x^2+6x+3)}$$ is decreasing positive .
So as a multiplication we deduce that the function is negative increasing so the second derivative is positive . $j$ is convex .
We have $j\left(\frac{x}{1-x}\right)=f(-x)$
We Differentiate  and using the fact that :
$k(x)=\frac{-1}{(1-x)^2}$ is negative decreasing and $j$ is negative decreasing  we deduce by multiplication that $-f'(-x)$ is decreasing so $f(-x)$ is concave on the interval .
Hope it helps you !
