Intersection of two a hyperplane and a sphere in n dimentions I am looking to see what would be the intersection of these:
$x_1^2 +x_2^2 +x_3^2 + x_4^2 =k_1$
$x_1 +x_2 +x_3 +x_4= k_2$
I think the intersection is a sphere. 
I would appreciate if anyone shed light on this. In addition, can we find a general formula for the intersection of these two surfaces when we have $n$ variables instead of 4. Thank you! 
 A: Sure. In 4-space, for $k_1 = 1$, this is a 3-sphere, consisting of all unit vectors orthogonal to $(1,1,1,1)$  (when $k_2 = 0$), or some offset-and-scaled down version as $k_2$ gets larger; when $|k_2|$ is large enough (probably larger than $1/2$, but I haven't checked carefully), you get the empty set, though. 
When you say "these two surfaces", you mean the analogue in $n$ dimensions, i.e.,
$$
x_1^2 + \ldots + x_n^2 = k_1 \\
x_1 + \ldots + x_n = k_2
$$
right? Because if you just take the sum of 4 variables, but in $\Bbb R^n$, then the result is just my sphere-or-empty-set answer, times $\Bbb R^{n-4}$, i.e., a kind of generalization of the cylinder ($\Bbb S^1 \times \Bbb R^1$). 
Assuming you DO mean the two $n$-variable equations, the intersection (for $k_2$ small compared to $k_1$) is just an $(n-1)$-sphere, as in the 2D, 3D, and 4D cases, or perhaps an empty set. 
(There's also the "edge case" where the intersection is a single point --- sort of a "smallest possible $n-1$--sphere.)
A: We can rotate the system so that (1,1,...,1) becomes aligned with the x-axis.
That is, the plane becomes $x_1=\frac{k_2}{\sqrt n}$, while the equation of the sphere doesn't change.
Consequently the intersection becomes:
$$\frac{k_2^2}{n} + x_2^2+x_3^2+...+x_n^2=k_1 \quad\Rightarrow\quad x_2^2+x_3^2+...+x_n^2=k_1-\frac{k_2^2}n
$$
This is an (n-1)-sphere provided that $k_1>\frac{k_2^2}n$. Otherwise it's a point or an empty set.
