How can I solve the function 2 x + 4 y - x^2 - y^2 in Mathematica. I have tried several Mathematica commands and none seem to solve this particular problem. The key to solving this problem is completing the squares which produces the answer x=1 and y=2. Solving the problem manually is fairly easy, but I would like to solve it in Mathematica.
Knowing what the function is equal to is part of the problem. It is actually equal to 5 but you don’t know that until you complete the squares. Once you know the function equals 5, you can plug the function into Solve[] and get the answer.