To find the maxima and minima of a function
To visualize this, one can create a contour plot of
The contour plot is created by iterating through various values of z and thereafter solving the equation
To find a solution to the optimization problem, one must find
The following plot was created by the program with
Note that this program is not perfect. There are certainly many ways to improve parts of the program, especially when it comes to solving the three equations