# When does $x_1+x_2+\dots+x_n=a,\space x_1^2+x_2^2+\dots+x_n^2=b$ have a unique solution?

Let $n\in \Bbb N$ be fixed. For which $a,b\in \Bbb R$ does the equation system $$x_1+x_2+\dots+x_n=a$$ $$x_1^2+x_2^2+\dots+x_n^2=b$$ have a unique solution for the $x_i$?

For example if $(n,a,b)=(20,200,2000)$ it has a unique solution.

You can look at this problem geometrically.

$B_b=\{x\in\mathbb{R}^n: x_1^2+x_2^2+\dots+x_n^2=b\}$ is sphere with radius $\sqrt{b}$

$A_a=\{x\in\mathbb{R}^n: x_1+x_2+\dots+x_n=a \}$ is plane with normal $(1,1,\dots,1)$ and distance from origin $\frac{|a|}{\sqrt{n}}$

To have unique solution $A_a \cap B_b$ has to be singleton. Geometrically: plane $A_a$ has to be tangent to $B_b$

So $\sqrt{b} = \frac{|a|}{\sqrt{n}}$.

If $(x_1,...,x_n)$ solves the equations then if $\pi$ is any permutation $(x_{\pi(1)},...,x_{\pi(n)})$ also solves them. In other words, any way of permuting the $x_i$'s will also lead to a solution. So the only way there could possibly be a unique solution is if $x_1 =$ ... $= x_n$, in which case each $x_i = {a \over n}$, and each $x_i^2 = {b \over n}$.

So if there is a unique solution one has to have ${a^2 \over n^2} = {b \over n}$ or just $a^2 = nb$. Conversely, given any $b \geq 0$, one can let $a = \pm \sqrt{nb}$ and get a unique solution where each $x_i = {a \over n}$.

• nice‌‌‌‌‌‌‌‌‌‌‌‌.
– user59671
Commented Mar 12, 2013 at 0:25

Note that from Cauchy-Schwarz, we have $$(x_1 + x_2 + \cdots + x_n) \leq \sqrt{n} \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}$$ and equality holds iff $x_1=x_2 = \cdots = x_n$. Hence, we need $$a^2 \leq nb$$ In general, if strict inequality holds there are infinitely many solutions. If the inequality is violated, then there is no solution. If equality holds, there is only one unique solution.

For $(n,a,b) = (20,200,2000)$, we have $a^2 = 200^2 = 40000 = 20 \times 2000 = nb$. Hence, for this specific case, there is only one solution, viz, $$x_1 = x_2 = x_3 \cdots = x_n = 10$$