max and min $3x-4x^3+12xy$ Find max and min to $$3x-4x^3+12xy$$ where $ x,y \ge 0$ and $x+y \le 1$.
Problem: When I put partial derivatives equal to each other, I get $y=-1/4$. Not what?
Attempt: 


 A: $$f(x,y) = 3x - 4x^3 + 12 xy \Rightarrow \frac{\partial f}{\partial x} = 3 - 12x^2 + 12y,  \frac{\partial f}{\partial y} = 12x$$
You have to pose derivatives equal to $0$:
$$\frac{\partial f}{\partial y} = 12x = 0 \Rightarrow x = 0$$
$$\frac{\partial f}{\partial x} = 3 - 12x^2 + 12y = 3 + 12y = 0 \Rightarrow y = -\frac{1}{4}$$
The point $A = (0, -\frac{1}{4})$ cannot be a minimum or maximum candidate in the region $x, y \geq0, x + y \leq 1$, since $A$ is outside this region.
At this point, you have to check what happens on the border of the region. The boundaries of this region are described by the followings:
$$x\in[0, 1] \wedge y = 0$$
$$y\in[0,1] \wedge x = 0$$
$$y = 1 -x \wedge x\in[0, 1]$$
Let's check what happen in the first segment. We can do this by posing $y=0$:
$$g(x) = f(x,0) = 3x - 4x^3 \Rightarrow \frac{\partial g}{\partial x} = 3 - 12x^2$$
Then:
$$\frac{\partial g}{\partial x} = 0 \Rightarrow 3 - 12x^2 = 0 \Rightarrow x = \pm\frac{1}{2}$$. We exclude $x = -\frac{1}{2}$ and we have a candidate point $B = (\frac{1}{2}, 0)$.
Let's check what happen in the second segment. We can do this by posing $x=0$:
$$h(y) = f(0,y) = 0$$
Every points in this segment are candidates.
Finally, 
Let's check what happen in the second segment. We can do this by posing $y=1-x$:
$$q(x) = f(x, 1-x) = 3x - 4x^3 + 12x(1-x) = 15x - 12x^2 - 4x^3 \Rightarrow \frac{\partial q}{\partial x} = 15 - 24x - 12x^2$$ 
Then:
$$\frac{\partial q}{\partial x} = 0 \Rightarrow x = \frac{1}{2}, x = -\frac{5}{2}$$
Excluding $x=-\frac{5}{2}$, we have a new candidate point $C = (\frac{1}{2}, \frac{1}{2})$
Finally, also vertices of region are candidates. The vertices are:
$$D=(0,0), E=(0,1), F=(1,0)$$.
Now, we have to check what happens to function on these points:
$$f(B) = 1$$
$$f(C) =  4$$
$$f(D) = 0$$
$$f(E) = 0$$
$$f(F) = -1$$
$$f(y\in[0,1] \wedge x = 0) = 0$$
Then, $C$ is the maximum and $F$ is the minimum.
A: HINT:
Use Lagrange multipler with KKT conditions. You'll have:
$$F(x,y,\lambda,\lambda_1,\lambda_2) = 3x - 4x^3 + 12xy - \lambda(x+y-1) - \lambda_1x - \lambda_2y$$
Now take partial derivatives and because those lambda things have to be zero, set them to zero. We know that if a product is zero then one of the multiples is zero. So check every possible combination and plug in the results you'll obtain.
A: That the gradient condition can not be satisfied means that there are no extremal points in the interior of the triangle. So you have to check the boundaries. All three segments and all three corner points. 
This can be done either as indicated by Stefan4024 using Lagrange multipliers, or you can eliminate one or two variables using the active conditions for the part of the boundary you are examining.
