Find the point $(x_0,y_0,z_0)$ closest to the origin in $\mathbb{R}^3$ that is on both $3x+y+z=5$ and $x+y+x=1$.
My current thoughts are to solve a Lagrange where, $x+y+z-1=0, 3x+y+z-5=0$ and some equation for the intercept is satisfied.
However, I am having difficult setting up the equation for the intercept.
edit:
Let $f(x,y,z)=z$
Then, let $g_1(x,y,z) = x+y+z-1, g_2(x,y,z) = 3x+y+z-5$ So, $g(x,y,z)=(g_1(x,y,z),g_2(x,y,z)$
Then we have lagrange $L=f(x,y,z)-(\lambda,\mu) * g(x,y,z)$
With, $\frac{\partial L}{\partial x}= -\lambda-3\mu=0$
$\frac{\partial L}{\partial x}= -\lambda-\mu=0$
$\frac{\partial L}{\partial z}= 1-\lambda-\mu=0$
However, I then get $\mu = \lambda$ and $\mu = \lambda -1$, so have run into a problem.
An alternative method, in case you're interested, is to use vector methods. First find the line of intersection of the planes by solving them simultaneously, which gives $$\underline{r}=\left(\begin{matrix}2\\0\\-1\end{matrix}\right)+\lambda\left(\begin{matrix}0\\1\\-1\end{matrix}\right)$$ Then you can find the foot of the perpendicular from the origin by solving for $\lambda$ $$\left[\left(\begin{matrix}2\\0\\-1\end{matrix}\right)+\lambda\left(\begin{matrix}0\\1\\-1\end{matrix}\right)\right]\cdot\left(\begin{matrix}0\\1\\-1\end{matrix}\right)=0$$ From this we obtain $\lambda=-\frac12$, so the closest point required is $$\left(\begin{matrix}2\\-\frac12\\-\frac12\end{matrix}\right)$$