Demand $z=x+y$ and $x^2/4 + y^2/5 + z^2/25 = 1$. What is the maximum value of $f(x,y,z) = x^2+y^2+z^2$? 
Demand $z=x+y$ and $x^2/4 + y^2/5 + z^2/25 = 1$. What is the maximum value of $f(x,y,z) = x^2+y^2+z^2$?

I've been attempting this with Lagrange multipliers in a few different ways. However, the resulting system of equations with two lagrangians has so many variables that it becomes very complicated. Can someone show how this is to be done manually?
I also attempted turning it into two unknowns by replacing $z$ with $x+y$. However, this also led nowhere.
 A: Beginning with the equation for the Lagrange Multipliers, it is a matter of (tedious) algebraic manipulation with a goal to systematically eliminate parameters. We have $x+y-z=0$ and $\frac{x^2}{4}+\frac{y^2}{5}+\frac{z^2}{25}=1$, $f(x,y,z)=x^2+y^2+z^2$
$$\begin{pmatrix}  2x \\ 2y \\ 2z  \end{pmatrix} = \lambda \begin{pmatrix}  1 \\ 1 \\ -1  \end{pmatrix} + \gamma \begin{pmatrix}  x/2 \\ 2y/5 \\ 2z/25  \end{pmatrix} \implies \begin{cases} 2x= \lambda+\frac{1}{2}\gamma x \\  2y= \lambda+\frac{2}{5}\gamma y \\  2z= -\lambda+\frac{2}{25}\gamma z  \end{cases}$$
$$\begin{cases} \lambda = 2x-\frac{1}{2}\gamma x \\ \lambda = 2y-\frac{2}{5}\gamma y \\ \lambda = -2z + \frac{2}{25}\gamma z \end{cases} \implies \begin{cases} \frac{1}{2}\gamma x-2x =  \frac{2}{5}\gamma y-2y \\   \frac{1}{2}\gamma x-2x = -\frac{2}{25}\gamma z +2z\end{cases} \implies \begin{cases} \gamma=\frac{2x-2y}{x/2-2y/5}  \\ \gamma = \frac{2x+2z}{x/2+2z/25}  \end{cases}$$
It then remains to solve the system of equations:
$$\frac{2x-2y}{x/2-2y/5} = \frac{2x+2z}{x/2+2z/25}\ \ \ \  \wedge \ \ \ \ x+y-z=0 \ \ \ \ \wedge \ \ \ \  \frac{x^2}{4}+\frac{y^2}{5}+\frac{z^2}{25}=1$$
The solutions to this system may be any of the following: maxima, minima, or saddle points of f(x,y,z) under the given constraints.  
edit: One of the resulting quadratics is factorable.  
$$\frac{2x-2y}{x/2-2y/5} = \frac{2x+2z}{x/2+2z/25} \implies (x-y)(25x+4z)=(5x+5z)(5x-4y)$$ After expanding and eliminating the z variable (z=x+y), the quadratic reduces to: $$21x^2+10xy-16y^2=0$$ $$(3x-2y)(7x+8y)=0$$ Thus, we have $y=(3/2)x$ or $y=(-7/8)x$, hence, an explicit solution from the quadratic formula using the ellipsoid constraint. Plugging these back into f, we see a maximum at $f(2\sqrt{\frac{5}{19}},3\sqrt{\frac{5}{19}},5\sqrt{\frac{5}{19}})=10$.
A: You have two equations in three unknowns, so just have to choose one variable to maximize over.  When you eliminate $z$ you have to do it from the second constraint as well as the objective function.  Your problem becomes to maximize $2x^2+2y^2+2xy$ subject to $x^2/4+y^2/5+(x+y)^2/25=1=\frac {29}{100}x^2+\frac 6{25}y^2+\frac 2{25}xy$  Now solve the second constraint for one of the variables using the quadratic formula, plug that into the objective, and the objective is a function of one variable.  Differentiate, set to zero.....
A: If $3x=2y$, we get a value $10$.
We'll prove that it's a maximal value.
Indeed, we need to prove that
$$x^2+y^2+z^2\leq10\left(\frac{x^2}{4}+\frac{y^2}{5}+\frac{z^2}{25}\right)$$ or
$$x^2+y^2+(x+y)^2\leq10\left(\frac{x^2}{4}+\frac{y^2}{5}+\frac{(x+y)^2}{25}\right)$$ or
$$(3x-2y)^2\geq0$$ and we are done!
