Originally Posted by
HallsofIvy As Tah said, you cannot use the Lagrange multiplier method on an inequality constraint like this.
What you can do is find x, y, z such that [itex]\nabla f= 0[/itex]. IF those are inside the ball, that is, if [itex]x^2+ y^2+ z^2< 1[/itex] then that might be a max or min. Here, of course, f(x,y,z)= x+ 2y- z which is linear so [itex]\nabla f= \vec{i}+ 2\vec{j}- \vec{k}[/itex] which is never 0. That means the max and min values must be ON the sphere, not inside it.
Now, there are two things you could do: use the Lagrange multiplier method on [itex]x^2+ y^2+ z^2= 1[/itex] as you have done. Yes, that gives [itex]1+ \lambda 2x = 0[6/itex], [itex]2 + \lambda 2y=0[/itex], [itex]-1 + \lambda 2z=0[/itex] and [itex]x2+y^2+zk^2=1[/itex]. One way I like to handle equations like these, since we really don't want to know [itex]\lambda[/itex] is to divide one equation by another. Since [itex]2\lambda x= -1[/itex] and [itex]2\lambda y= -2[/itex], y/x= 2 and y= 2x. Since, also, [itex]2\lambda z= 1[/itex], z/x= -1 so z= -x. Put y= 2x and z= -x into [itex]x^2+ y^2+ z^2= 1[/itex] and solve for x.
The other thing you could do is write f(x,y,z) ON the surface of the sphere. In spherical coordinates, [itex]x= \rho cos(\theta)sin(\phi)[/itex], [itex]y= \rho sin(\theta)sin(\phi)[/itex], [itex]z= \rho cos(\phi)[/itex]. On the surface of this sphere, [itex]\rho= 1[/itex] so [itex]x= cos(\theta)sin(\phi)[/itex], [itex]y= sin(\theta)sin(\phi)[/itex], [itex]z= cos(\phi)[/itex]. f(x,y,z)= x+ 2y- z= [itex]cos(\theta)cos(\phi)+ 2\sin(\theta)cos(\phi)- cos(\phi)[/itex]. Now minimize that.