Week 2: Closure#

Continue working on the the preparatory exercises and the in-class exercises that you have not yet completed.

Key Concepts#

  • Vector functions of multiple variables

  • Directional derivatives

  • Differentiability

  • The Jacobian matrix (or just the Jacobian)

  • The gradient vector

  • The chain rule

  • The Hessian matrix (or just the Hessian)

If there are still concepts you are unsure about, you should reread the relevant chapters in the textbook or revisit the exercises of the week.

Extra Exercises#

We do not expect you to complete more exercises than those from from the week’s program. The following additional exercises are purely an optional offer for those who want extra practice and challenge.

1: Discontinuity of Heaviside’s step function#

This exercise revisits the topic from week 1: Continuity (or rather, the lack of continuity).

Question a#

Plot Heaviside’s step function given here in Python.

Question b#

Indicate at which points the function is discontinuous.

Question c#

Can you prove that the function is discontinuous at \(x_0=0\)?

2: Orthogonality between a Parametrized level curve and the Gradient#

We consider a function \(f: \mathbb{R}^2 \to \mathbb{R}\) given by

\[\begin{equation*} f(x,y) = x^2 - 4x + y^2. \end{equation*}\]

A level curve of \(f\) is given by \(f(x,y) = c\) for a constant \(c>-4\).

Question a#

Show that the gradient of \(f\) is given by

\[\begin{equation*} \nabla f(x,y) = (2x - 4, 2y). \end{equation*}\]

Question b#

Consider the parametrized curve \(\pmb{r}(t)\) given by:

\[\begin{equation*} \pmb{r}(t) = (t+2, \sqrt{c - 4 - t^2}), \quad t \in [-\sqrt{c+4}, \sqrt{c+4}]. \end{equation*}\]

Verify that this curve is located on the level curve \(f(x,y) = c\).

Question c#

Calculate the tangent vector \(\pmb{r}'(t)\) to the curve, and investigate whether it is orthogonal to the gradient \(\nabla f(x,y)\) at every point \(\pmb{r}(t)\), \(t \in \Bigl]-\sqrt{c+4},\sqrt{c+4}\Bigr[\).

Question d#

Can you adjust the parametrization used above to parametrize the entire level curve \(f(x,y)=c\)?

3: Directional Derivative and the Gradient#

Consider the function

\[\begin{equation*} g(x,y)= x^2+y^2. \end{equation*}\]

Question a#

Show that the directional derivative of \(g\) in the direction of a unit vector \(\pmb{v} \in \mathbb{R}^2\) is given by

\[\begin{equation*} \nabla_{\pmb{v}} g(x,y)= \langle \pmb{v}, (2x, 2y) \rangle. \end{equation*}\]

Question b#

Compute the directional derivative of \(g\) at the point \((2,1)\) in the following directions:

  • \(\pmb{e}_1 = (1,0)\) (first coordinate direction).

  • \(\pmb{e}_2 = (0,1)\) (second coordinate direction).

  • \(\pmb{v}_1 = \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right)\) (diagonal direction).

  • \(\pmb{v}_2 = \left(\frac{2}{\sqrt{5}}, \frac{1}{\sqrt{5}}\right)\) (another unit direction).

  • The opposite direction of the above directions.

  • In the direction of the gradient \(\frac{\nabla g(2,1)}{||\nabla g(2,1)||}\).

  • In the opposite gradient direction \(-\frac{\nabla g(2,1)}{||\nabla g(2,1)||}\).

Question c#

The directional derivative is by definition the rate of change of the function in a given direction. Which direction gives the largest and the smallest directional derivatives, respectively?