I’m teaching a course on multivariable calculus at Reykjavik University, in Iceland, with a slight twist. The students turn in four problem sets over the semester, each one containing four problems. Most of the problems utilize MatLab for either vizualization or for the solution. Here’s an example.

Problem. Part A. Given a function of two variables $x,y$ write a MatLab function that can make a rudimentary test for local maxima, minima and saddle points in the following way: The input should be a function $f$, a point $P_0 = (x_0,y_0)$, a real number $\epsilon > 0$, and a natural number $n \geq 1$. What the MatLab function should do is randomly select $n$ points $P_1, P_2, \dots, P_n$ on a circle (in the $xy$-plane) of radius $\epsilon$ and center $P_0$; calculate the directional derivatives along the vectors $\vec{P_0P_n}$. The output should be:

1. “The function has a local maximum at $P_0$.” if all the directional derivatives are negative.
2. “The function has a local minimum at $P_0$.” if all the directional derivatives are positive.
3. “The function has a saddle point at $P_0$.” if the directional derivatives are both positve and negative.

Part B. Give an example of a function with the property that: It accurately detects a local maximum or minimum at a point $P_0$ for $\epsilon < 1$ but fails to detect it if $\epsilon > 1$.

I haven’t assigned this problem yet but am very excited to see the results. I think this problem should give the students a good feeling for what local maxima, minima and saddle points “look like”.