Find the closest point to the origin of $\{\alpha x + \beta y + \gamma z = c\}\cap\{x+y+z=1\}.$ On the line given by this intersection:
$$\{\alpha x + \beta y + \gamma z = c\}\cap\{x+y+z=1\}.$$ We need to find the closest point to the origin. My attempt:
Let's look at $f(x,y,z)=x^2 + y^2 + z^2$, this is the euclidean norm squared. Now, setting the constraints $g_1(x,y,z)=x+y+z-1$ and $g_2(x,y,z)=\alpha x + \beta y + \gamma z - c$.
We can denote that the intersection is a compact set since it's closed and blocked. Hence, by Weierstrass theorem we can guarantee that $f$ has minimum and maximum in the intersection above.
Note that $f$,$g_1$ and $g_2$ are $C^1$ functions. In addition, $\nabla g_1=(1,1,1)$ and $\nabla g_2=(\alpha,\beta,\gamma)$ are linearly dependent if and only if $\alpha = \beta = \gamma$.
If they're equal we have two cases: One is $\alpha=c$, in this case the intersection isn't empty iff $\alpha=c=1$ and then we'll get that $(x,y,z)=(\frac{1}{3}, \frac{1}{3},\frac{1}{3})$. The other is that $\alpha \ne c$ and then the intersect is empty and there isn't a point on which we can say it is the closest to the origin since there're no points at all.
Under the assumption that at least one of then is different from the rest, we can use Lagrange multiplier theorem and obtain the following:
$\nabla f=\lambda_1\nabla$$g_1+\lambda_2\nabla$$g_2$. Denote this equations system:
\begin{cases}2x=\lambda_1+\alpha\lambda_2 \\ 2y=\lambda_1+\beta\lambda_2 \\ 2z=\lambda_1+\gamma\lambda_2 \\ x+y+z-1=0 \\ \alpha x + \beta y + \gamma z - c=0\end{cases}.
I got stuck here, thanks in advanced!
 A: My first suggestion is to ditch the factors of $2$, but I'll leave them in so as not to confuse you. You should substitute your first three equations into the last two. Let $\alpha+\beta+\gamma = A$ and $\alpha^2+\beta^2+\gamma^2=B$. Then you'll obtain
\begin{align*}
3\lambda_1 + A\lambda_2 &= 2,\\
A\lambda_1 + B\lambda_2 &= 2c.
\end{align*}
By inverting a matrix or using Cramer's rule, you will be almost at the end. Can you take it from here?
(If you know some linear algebra, there are more natural ways to set this up with the matrix $\begin{bmatrix} 1 & a \\ 1 & b \\ 1 & c\end{bmatrix}$.)
A: The problem can be solved by algebraic methods. Assume the vectors $(1,1,1)$ and $(\alpha,\beta,\gamma)$ are not paralell.
Then the vectors $$
v_1=(1,1,1),\qquad v_2=(\alpha,\beta,\gamma)-{1\over 3}(\alpha+\beta+\gamma)(1,1,1)$$ are orthogonal, and $v_2\neq 0.$
Denote $u=(x,y,z).$
The conditions describing the intersection of the planes are
$$\langle u,v_1\rangle =1,\quad \langle u, v_2\rangle =c-{\alpha+\beta+\gamma\over 3}$$
By the Bessel inequality
$$x^2+y^2+z^2=\|u\|^2\ge {\langle u,v_1\rangle^2\over \|v_1\|^2}+{\langle u,v_2\rangle^2\over \|v_2\|^2}\\
={1\over 3}+\left (c-{\alpha+\beta+\gamma\over 3}\right )^2{3\over 2(\alpha^2+\beta^2+\gamma^2-\alpha\beta-\alpha\gamma-\beta\gamma)}$$
The last expression gives the minimal value of the function $x^2+y^2+z^2,$ which is attained for $$u=
{\langle u,v_1\rangle\over \|v_1\|}v_1+{\langle u,v_2\rangle\over \|v_2\|}v_2\\=  {1\over \|v_1\|}v_1+\left (c-{\alpha+\beta+\gamma\over 3}\right ){1\over \|v_2\|}v_2$$
A: This looks like just a regular linear system of equations (given that in practice you'd know the values of $\alpha,\beta$ and $\gamma$. You can write it like:
$$\left(
\begin{array}{ccccc}
 2 & 0 & 0 & -1 & -\alpha  \\
 0 & 2 & 0 & -1 & -\beta  \\
 0 & 0 & 2 & -1 & -\gamma  \\
 1 & 1 & 1 & 0 & 0 \\
 \alpha  & \beta  & \gamma  & 0 & 0 \\
\end{array}
\right)\left(
\begin{array}{c}
 x \\
 y \\
 z \\
 \lambda _1 \\
 \lambda _2 \\
\end{array}
\right)=\left(
\begin{array}{c}
 0 \\
 0 \\
 0 \\
 1 \\
 c \\
\end{array}
\right)$$
Doing a dose of Gaussian Elimination, Cramers Rule, or just taking the inverse of the big scary looking matrix on both sides get's you your solutions:
$$\left(
\begin{array}{c}
 x \\
 y \\
 z \\
 \lambda _1 \\
 \lambda _2 \\
\end{array}
\right)=
\left(
\begin{array}{c}
 \frac{-\alpha  (\beta +\gamma )+\beta ^2+\gamma ^2+c (2 \alpha -\beta -\gamma )}{2 \left(\alpha ^2-\alpha  (\beta +\gamma )+\beta ^2-\beta  \gamma +\gamma ^2\right)} \\
 \frac{\alpha ^2-\alpha  \beta +\gamma  (\gamma -\beta )-c (\alpha -2 \beta +\gamma )}{2 \left(\alpha ^2-\alpha  (\beta +\gamma )+\beta ^2-\beta  \gamma +\gamma ^2\right)} \\
 \frac{\alpha ^2-\gamma  (\alpha +\beta )+\beta ^2-c (\alpha +\beta -2 \gamma )}{2 \left(\alpha ^2-\alpha  (\beta +\gamma )+\beta ^2-\beta  \gamma +\gamma ^2\right)} \\
 \frac{\alpha ^2+\beta ^2+\gamma ^2-c (\alpha +\beta +\gamma )}{\alpha ^2-\alpha  (\beta +\gamma )+\beta ^2-\beta  \gamma +\gamma ^2} \\
 -\frac{\alpha +\beta -3 c+\gamma }{\alpha ^2-\alpha  (\beta +\gamma )+\beta ^2-\beta  \gamma +\gamma ^2} \\
\end{array}
\right)$$
