Worksheet 2-1 (with Solutions)#

Download: CMSE382-WS2_1.pdf · Solution PDF

Warning

This is an AI-generated transcript of the worksheet and may contain errors or inaccuracies. Please refer to the original course materials for authoritative content.


Worksheet 2-1: Q1#

The function \(f(x)=3x^4 - 28x^3 + 84x^2 - 96x\) over \([-1,6]\) is plotted at desmos.com/calculator/nevlfz0yxp. The derivative of \(f\) is \(f'(x) = 12x^3 - 84x^2 +168x-96= 12(x-1)(x-2)(x-4)\).

  • Using the derivative, find all critical points of \(f(x)\).

    Solution

    Critical points occur where \(f'(x)=0\) or is undefined, plus the endpoints of the interval. Setting \(12(x-1)(x-2)(x-4)=0\) gives \(x=1,2,4\). Including endpoints: critical points are \(x=-1, 1, 2, 4, 6\).

  • Identify all stationary points, and for each stationary point, identify its type (min, max, saddle).

    Solution

    The stationary points (where \(f'(x)=0\)) are \(x=1, 2, 4\). Using \(f''(x) = 36x^2-168x+168\):

    • \(x=1\): \(f''(1) = 36 > 0\) → local min

    • \(x=2\): \(f''(2) = -24 < 0\) → local max

    • \(x=4\): \(f''(4) = 72 > 0\) → local min

  • Find the global minimum and maximum of \(f(x)\) over the interval \([-1,6]\).

    Solution

    Evaluate at all critical points and endpoints:

    \(x\)

    \(f(x)\)

    \(-1\)

    \(211\)

    \(1\)

    \(-37\)

    \(2\)

    \(-32\)

    \(4\)

    \(-64\) ← global min

    \(6\)

    \(288\) ← global max

    Global minimum at \(x=4\), global maximum at \(x=6\).


Worksheet 2-1: Q2#

Find the stationary points of \(f(x,y)=6x^2 y - 3x^3 + 2y^3 - 150y\).

(You can visually check your answer at desmos.com/3d/xa4komuwmb.)

Solution

Compute the gradient and set it to zero:

\[\begin{split}\nabla f(x,y) = \begin{bmatrix} 12xy - 9x^2 \\ 6x^2 + 6y^2 - 150 \end{bmatrix}\end{split}\]

From the first equation: \(3x(4y - 3x) = 0\), so \(x=0\) or \(y = \frac{3}{4}x\).

From the second equation: \(x^2 + y^2 = 25\).

  • Case \(x=0\): \(y^2 = 25 \Rightarrow y = \pm 5\). Stationary points: \((0,5)\) and \((0,-5)\).

  • Case \(y=\frac{3}{4}x\): Substituting gives \(\frac{25}{16}x^2 = 25 \Rightarrow x = \pm 4\), so \(y = \pm 3\). Stationary points: \((4,3)\) and \((-4,-3)\).


Worksheet 2-1: Q3#

On a quiz, Dr. Munch asks about a function \(f:U \to \mathbb{R}\) defined on \(U \subseteq \mathbb{R}^n\) where all partial derivatives of \(f\) exist.

  • Kylo Ren writes: “At a local optimum, the gradient is zero, so \(\nabla f(x^*)=0\).”

    Solution

    Wrong. The condition only holds when \(x^*\) is in the interior of \(U\). If \(x^*\) is on the boundary, the gradient may not be zero. Example: \(f(x) = x\) on \(U = [0,1]\) has its global minimum at \(x^*=0\) but \(\nabla f(0) = 1 \neq 0\).

  • Rey Skywalker writes: “Since \(\nabla f(\mathbf{x}^*)=0\), \(f\) has a local optimum.”

    Solution

    Wrong. A zero gradient is a necessary but not sufficient condition for a local optimum. The point could also be a saddle point.

  • Poe Dameron writes: “Since \(f\) has a local optimum at \(\mathbf{x}^*\) and \(\mathbf{x}^*\) is in the interior of \(U\), the gradient is zero, meaning \(\nabla f(\mathbf{x}^*)=0\).”

    Solution

    Correct! This is exactly the first-order necessary condition for an interior local optimum.


Worksheet 2-1: Q4#

Let \(f(x,y)=2x+3y:S\to \mathbb{R}\) and \(S=B[0,1]=\{(x,y): x^2+y^2 \leq 1\}\).

(a) We call \(f\) a linear map if there is a matrix \(A\) such that \(f(x,y)=A \mathbf{x}\), where \(\mathbf{x}=\begin{bmatrix} x\\ y \end{bmatrix}\). Find the matrix \(A\) to show that \(f\) is a linear map.

Solution

\(A = \begin{bmatrix} 2 & 3 \end{bmatrix}\)

(b) Note that because \(A\) is just a vector, \(A\mathbf{x}\) is the same as the dot product. Use the Cauchy-Schwarz inequality to find \(\argmin_{x \in S} f(x)\) and \(\argmax_{x \in S} f(x)\).

Solution

By Cauchy-Schwarz: \(|A \cdot \mathbf{x}| \leq \|A\|_2 \|\mathbf{x}\|_2 \leq \|A\|_2 = \sqrt{13}\) for \(\mathbf{x} \in S\).

Equality holds when \(\mathbf{x}\) is parallel to \(A\):

\[\begin{split}\argmax_{x \in S} f(x) = \frac{A}{\|A\|_2} = \frac{1}{\sqrt{13}}\begin{bmatrix}2\\3\end{bmatrix}, \qquad \argmin_{x \in S} f(x) = -\frac{1}{\sqrt{13}}\begin{bmatrix}2\\3\end{bmatrix}\end{split}\]

(c) What do the points you found in part (b) represent?

Solution

These are the global minimum and global maximum of \(f\) over \(S\), respectively.