I wrote this question on Maths.stackexchange but perhaps this community suits better (?)
I need to ask you for this question, which is a rather general one, in order to understand how to behave when studying maxima and minima with constraints, in many variables. The specific question is the following: suppose I have some $f(x, y, z)$ (in this case I'm specifically asking for three variables) subject to two constraint: $$ \begin{cases} g(x, y, z) \leq 0 \\\\ h(x, y, z) = 0\end{cases}$$
Question 1: since I have mixed constraints (an equality and an inequality constraint), should I still study internal points (when referring to $g$), hence $\nabla f(x, y, z) = (0, 0, 0)$ or not?
Question 2: I then use Langrange multipliers in the usual way, by building the Lagrangian
$$L(x, y, z, \lambda, \mu) = f(x, y, z) - \lambda g(x, y, z) - \mu h(x, y, z)$$
(then I know how to proceed).
Say I will be able to reduce the problem to a two dimensiona one, and I cannot go further than this. Then I study $\nabla f(x, y) = (0, 0)$ and I hopefully find some points. What now? Should I use them to find the third point $z$ by using the constraints, or should I study $f(x, y)$ with the Hessian matrix?
Thank you!
AN EXAMPLE
Just to make things more concrete, I thought to write here an example for what I meant. Say $$f(x, y, z) = xyz$$
Subject to $$\begin{cases} x^2+y^2+z^2 \leq 1 \\\\ x+y+z = 1 \end{cases}$$
So a sphere and a plane, which intersect to form a cicumference.
Internal points
$$\nabla f(x, y, z) = (0, 0, 0)$$ returns points of the form
$$(x, 0, 0) \qquad \qquad (0, y, 0) \qquad \qquad (0, 0, z)$$
Hence on the axis. And here the question one: should I consider them, or should I interpret the two constraints as the circumference and stop?
In all those points, $f(\cdot)= 0$.
Going on:
$$L(x, y, z, \lambda, \mu) = xyz - \lambda(x^2+y^2+z^2-1) - \mu(x+y+z-1)$$
And the derived equations read
$$ \begin{cases} yz = 2\lambda x + \mu \\ xz = 2\lambda y + \mu \\ xy = 2\lambda z + \mu \\ \text{the two constraints} \end{cases} $$
I was able to write down:
$$\mu = zy - 2\lambda x$$ hence from arranging the second with this one:
$$\lambda = \frac{-z}{2}$$
And then subtituting all in the third:
$$xy = -z^2 + zy + zx$$
Using the second constraint for $z \to z = 1-x-y$ I conclude with
$$f(x, y) = 2x^2+ 2y^2-3x-3y+xy +1$$
So at this point: $\nabla f(x, y) = (0, 0)$ gives the points
$$x = 0 \qquad \qquad y = 0$$
$$x = \frac{3}{5} \qquad \qquad y = \frac{3}{5}$$
and fron this, question two: should I find $z$ and then simply evaluate $f$ on this points, or should I go on with $f(x, y)$ with eh Hessian?
- Bonus question: am I reasoning right or wrong? Am I missing something?