See attached file.
Let's first review the theory of Lagrange multipliers. I'm going to explain it in a more general way than is usually done. Suppose you have to find variables x1, x2,... etc. that extremize some function f(x1, x2,...) such that some number of constraints
g1(x1,x2,...) = 0, g2(x1,x2,...) = 0, ... are met. When you don't have any constraints you have to set all the partial derivatives of f equal to zero. The argument is that if one particular partial derivative is not zero, then you could change that variable and get a higher (or lower) value for the function which means that you are not at the extremal point there. So, all the partial derivatives have to be zero.
In case of constraints the above argument that all partial derivatives have to be zero ...
A detailed solution is given. A review of the Lagrange multiplier method is included.