Find the range of $P= \frac{\sum_{1}^n x_i}{\prod _{1}^n (x_i^2+1)}$ When I solved the following problem.
Find the range of $B\equiv\dfrac{x+y}{(x^2+1)(y^2+1)}$ where $x,y \in\mathbb{R}$.
Solution.
Setting $x=\tan u$ and $y=\tan v$, expression is $\frac{\sin 2u+\sin 2v+\sin (2u+2v)}4$
And from there, it is not very complex to get upperbound when $u=v=\frac{\pi}6$ and opposite lowerbound.
Hence the result : $\boxed{\text{Range is }\left[-\frac{3\sqrt 3}8,\frac{3\sqrt 3}8\right]}$
But I don't how to solve the generalization problem: 
Find the range of $P=\displaystyle \dfrac{\sum_{1}^n x_i}{\prod _{1}^n (x_i^2+1)}$ where $x_i \in\mathbb{R}$.
 A: Notice that:


*

*$P$ is continuous on $\mathbb R^n$.

*$P(x_1, \dotsc, x_n) \ge 0$ for any $x_1, \dotsc, x_n \ge 0$.

*$P(0, \dotsc, 0) = 0$.

*$P(x_1, \dotsc, x_n) \to 0$ as $(x_1, \dotsc, x_n) \to \infty$.


These imply that the image of $[0, \infty)^n$ under $P$ has the form $[0, M]$ for some $M \ge 0$.
Also,


*$P(-x_1, \dotsc, -x_n) = -P(x_1, \dotsc, x_n)$ for any $x_1, \dotsc, x_n \in \mathbb R$.

*$P(-\lvert x_1 \rvert, \dotsc, -\lvert x_n \rvert) \le P(x_1, \dotsc, x_n) \le P(\lvert x_1 \rvert, \dotsc, \lvert x_n \rvert)$ for any $x_1, \dotsc, x_n \in \mathbb R$.


These imply that the image of $(-\infty, 0]^n$ under $P$ is $[-M, 0]$ and that the image of the whole $\mathbb R^n$ under $P$ is thus $[-M, M]$.
Now, suppose $x_1, \dotsc, x_n \ge 0$ and $P(x_1, \dotsc, x_n) = M$. Since $M$ is a maximum for $P$, we have that
\begin{align*}
\frac \partial {\partial x_i} P & = \frac {1 \cdot \prod_j (x_j^2 + 1) - (\sum_j x_j) \cdot 2 x_i \prod_{j \neq i} (x_j^2 + 1)} {\prod_j (x_j^2 + 1)^2} \\
& = \frac {x_i^2 + 1 - 2(\sum_j x_j) x_i} {(x_i^2 + 1) \prod_j (x_j^2 + 1)} = 0
\end{align*}
Therefore, if we let $s = \sum_j x_j$, then all the $x_i$'s satisfy the same equation
$$x^2 - 2 s x+ 1 = 0$$
Since the equation has at least one solution, its discriminant must be nonnegative, i.e., $s^2 \ge 1$. Since we are assuming $x_1, \dotsc, x_n \ge 0$, we have $s \ge 0$, therefore $s \ge 1$.
Now, the solutions to the equation are $s + \sqrt{s^2 - 1}$ and $s - \sqrt{s^2 - 1}$. If $s = 1$, then they are both equal to $1$, and so all the $x_i$'s must be equal to $1$ (this can only happen if $n = 1$). If $s > 1$, then $\sqrt{s^2 - 1} > 0$ and $x_i$ can't be equal to the solution $s + \sqrt{s^2 - 1}$, because $x_i \le s < s + \sqrt{s^2 - 1}$. Therefore all the $x_i$'s must be equal to $s - \sqrt{s^2 - 1}$.
Since all the $x_i$'s are equal to the same $x$, we have that $s = n x$, and so $x$ satisfies the equation
$$x^2 - 2n x^2 + 1 = 0$$
that is,
$$x = \frac 1 {\sqrt {2n - 1}}$$
From this we can compute the maximum of $P$:
$$\sum_i x_i = \frac n {\sqrt {2n - 1}}$$
$$\prod_i (x_i^2 + 1) = \left (\frac 1 {2n - 1} + 1 \right )^n = \left ( \frac {2n} {2n - 1} \right )^n$$
and finally, the maximum is
$$M = \frac {\frac n {\sqrt {2n - 1}}} {\left ( \frac {2n} {2n - 1} \right )^n} = \frac { (2n - 1)^n } {2^n n^{n-1} \sqrt {2n - 1}}$$
The range of $P$ is then $[-M, M]$.
