Describe the maximum value of OP, O being the origin of co ordinates where P describes the curve $\displaystyle x^2 + y^2 + 2z^2 = 5, x+2y+z = 5. $

While solving the problem, taking $\displaystyle G(x,y,z, \lambda_{1}, \lambda_{2}) = x^2 + y^2 + z^2 + \lambda_{1} (x^2 + y^2 + 2z^2 - 5) + \lambda_{2} (x+2y+z - 5) $ and framing the differential equations by differentiating $\displaystyle \ G $ with respect to $\displaystyle \ x, \ y, \ z, \lambda_{1}, \lambda_{2} $ and solving, I get the following relations: $\displaystyle x = \lambda, \ y = 2 \lambda, \ z = - \lambda $ where $\displaystyle \lambda = \frac{- \lambda_{2}}{2(1+\lambda_{1})} $

Now I have $\displaystyle \ x, \ y, \ z $ as functions of one variable and I have to satisfy two constraints. How is it possible? Where is my understanding of Lagrange's Multipliers flawed?