I had general questions about finding extrema subject to constraints. If I have a function, let's say:
$f(x,y) = x^2+y^2-xy-x-y$
and I want to find its max/min in the domain $D = \{ (x,y)| x+y \leq 3, x \geq 0 , y \geq 0 \}$ (it looks like a triangle)
So, I looked for the the critical points inside D(inside the triangle) and then in the 3 outer lines of the triangle.
However,I saw, that I also needed to take into account the points (0,0) (0,3) and (3,0). This is my first question. Why do I need to take into account these points? Why aren't they included already in the three line segments?
And my second question is that when I find the max/min in D by equating the gradient of f to the 0 vector, I get the point (1,1). Do I need to make sure that this point is NOT a saddle point by using for example the Hessian criteria? Or can I, at the end, just evaluate f at (1,1) and compare it to the value of f given by the rest of critical points and then decide wether it is a max or min value?

Here's your function over $D$:
Setting the derivative of $f$ to zero will find a local extremum (or inflection point) within a region, but if an extremum is on the boundary, in general it will not.
Take the simple one-dimensional case $f(x) = x$ over $0 \leq x \leq 1$. Your derivative is never zero, but the maximum lies on the boundary $(x = 1)$. So you have to check those.
Using this fact you'll find the extrema at the corners of your $D$ by finding the values at the ends of each line segment, and hence will not need to also check the corner points individually.