When drawing a contour graph of say,
$f(x,y) = \frac12x^2 + \frac13y^3 - xy - x + y$
, there is a saddle point at point $(1,0)$. How can I determine the slopes of the two lines that meet at this point when a contour graph of $f(x,y) = 0.5$?(ie. on the level of point (1,0))
Thank you.
Let $\mathbf{x} = (x,y) \in \mathbb{R}^2$ be a point, and $f(\mathbf{x}) = f(\mathbf{x}_0)$ be the contour line passing through point $\mathbf{x}_0$. By Taylor expansion around $\mathbf{x}_0$ we have
\begin{equation} f(\mathbf{x}) = f(\mathbf{x}_0) + \nabla f(\mathbf{x}_0) (\mathbf{x} - \mathbf{x}_0) + \frac{1}{2!} (\mathbf{x} - \mathbf{x}_0)^{\intercal}\mathbf{H}(\mathbf{x}_0) (\mathbf{x} - \mathbf{x}_0) + \mathcal{O}\left( \left| \mathbf{x} - \mathbf{x}_0 \right|^3 \right), \end{equation}
where $\mathbf{H}(\mathbf{x})$ is the Hessian matrix,
\begin{equation} \mathbf{H}(\mathbf{x}) = \begin{bmatrix} \frac{\partial^2 f(x,y)}{\partial x^2} & \frac{\partial^2 f(x,y)}{\partial x \partial y} \\ \frac{\partial^2 f(x,y)}{\partial x \partial y} & \frac{\partial^2 f(x,y)}{\partial y^2} \end{bmatrix} \end{equation}
For all $\mathbf{x}$ on the contour line we have $f(\mathbf{x}) = f(\mathbf{x}_0)$. Also if $\mathbf{x}_0$ is a saddle point, we have $\nabla f(\mathbf{x}_0) = \mathbf{0}$. Thus, the Taylor expansion on the contour curve and in the vicinity of $\mathbf{x}_0$ becomes
\begin{equation} 0 = \frac{1}{2} (\mathbf{x} - \mathbf{x}_0)^{\intercal}\mathbf{H}(\mathbf{x}_0) (\mathbf{x} - \mathbf{x}_0) + \mathcal{O}\left( \left| \mathbf{x} - \mathbf{x}_0 \right|^3 \right) \end{equation}
When $\mathbf{x} \to \mathbf{x}_0$, the higher order terms vanish. We want to find the direction vector $\mathbf{r} = \mathbf{x} - \mathbf{x}_0$ such that
\begin{equation} \mathbf{r}^{\intercal} \mathbf{H}(\mathbf{x}_0) \mathbf{r} = 0. \end{equation}
Here $\mathbf{r}$ is a vector, that when $\mathbf{x} \to \mathbf{x}_0$, becomes tangent to the contour curve at saddle point $\mathbf{x}_0$. Once we found $\mathbf{r}$, its direction is what you are asking.
In your example,
\begin{equation} \mathbf{H}(x=1,y=0) = \begin{bmatrix} 1 & -1 \\ -1 & 0 \end{bmatrix} \end{equation}
Let $\mathbf{r} = (r_x,r_y)$ be components of $\mathbf{r}$. Then
\begin{equation} \begin{bmatrix} r_x & r_y \end{bmatrix} \begin{bmatrix} 1 & -1 \\ -1 & 0 \end{bmatrix} \begin{bmatrix} r_x \\ r_y \end{bmatrix} = 0 \end{equation}
or $r_x(r_x - r_y) - r_x r_y = 0$. Solving yields $\mathbf{r} = (0,1)$ or $\mathbf{r} = (2,1)$, which solution is unique upto a scale factor. Thus two directions of intersecting controur lines are
\begin{equation} \theta = \tan^{-1}(r_y/r_x) = \begin{cases} 90^{\circ} \\ 26.56^{\circ} \end{cases} \end{equation}
Here is a plot, that at $(x=1,y = 0)$ two contour lines $f(1,0) = 0.5$ intersect, with slopes $+\infty$ and $1/2$.