Worksheet 1-3 (with Solutions)#
Download: CMSE382-WS1-3.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 1-3: Q1#
Circle all the properties of each given set.
\(S_1 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 < 1\}\)
Open Closed Bounded Compact
Solution
Interior of the disk. Open and bounded.
\(S_2 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 \leq 1\}\)
Open Closed Bounded Compact
Solution
Closed disk. Closed, bounded, and therefore also compact.
\(S_3 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 = 1\}\)
Open Closed Bounded Compact
Solution
Circle. Closed, bounded, and therefore also compact.
\(S_4 = [0, 1) \subset \mathbb{R}\)
Open Closed Bounded Compact
Solution
Half-open interval. Bounded only — neither open nor closed, so not compact.
\(S_5 = (0, 1) \cup (2, 3) \subset \mathbb{R}\)
Open Closed Bounded Compact
Solution
Union of open intervals. Open and bounded.
\(S_6 = [0, 1] \cup [2, 3] \subset \mathbb{R}\)
Open Closed Bounded Compact
Solution
Union of closed intervals. Closed, bounded, and therefore also compact.
\(S_7 = \{(x,y) \in \mathbb{R}^2 \colon x \geq 0, y\geq 1 \}\)
Open Closed Bounded Compact
Solution
First quadrant above \(y=1\). Closed, but unbounded, so not compact.
Worksheet 1-3: Q2#
Find the gradient for the scalar-valued function \(f(x,y,z)=x^4 + 3yz\) at \((1,2,3)\).
Solution
\[\begin{split}\nabla f(x,y,z) = \begin{bmatrix} 4x^3 \\ 3z \\ 3y \end{bmatrix}, \qquad \nabla f(1,2,3) = \begin{bmatrix} 4 \\ 9 \\ 6 \end{bmatrix}\end{split}\]Find the directional derivative of the function at \((1,2,3)\) in the direction of a unit vector parallel to \(\mathbf{u}=(1,-2,2)\).
Solution
First find the unit vector:
\[\|(1,-2,2)\| = \sqrt{1+4+4} = 3 \implies \hat{\mathbf{u}} = \left(\tfrac{1}{3}, -\tfrac{2}{3}, \tfrac{2}{3}\right)\]Then compute the directional derivative:
\[\begin{split}\nabla f(1,2,3) \cdot \hat{\mathbf{u}} = \begin{bmatrix} 4 & 9 & 6 \end{bmatrix} \begin{bmatrix} 1/3 \\ -2/3 \\ 2/3 \end{bmatrix} = \frac{4 - 18 + 12}{3} = -\frac{2}{3}\end{split}\]Find the Hessian for \(f\) at \(\mathbf{x}=(1,2,3)\).
Solution
\[\begin{split}\nabla^2 f(x,y,z) = \begin{pmatrix} 12x^2 & 0 & 0 \\ 0 & 0 & 3 \\ 0 & 3 & 0 \end{pmatrix}, \qquad \nabla^2 f(1,2,3) = \begin{pmatrix} 12 & 0 & 0 \\ 0 & 0 & 3 \\ 0 & 3 & 0 \end{pmatrix}\end{split}\]
Worksheet 1-3: Q3#
Consider the function \(f(x_1, x_2) = x_1^2 + 2x_1 x_2 + x_2^2\) and the point \(\mathbf{x} = (1, 1)\).
Compute \(\nabla f(\mathbf{x})\) at \(\mathbf{x} = (1, 1)\).
Solution
\(\frac{\partial f}{\partial x_1} = 2x_1 + 2x_2 = 4\) and \(\frac{\partial f}{\partial x_2} = 2x_1 + 2x_2 = 4\), so \(\nabla f(1,1) = (4, 4)^T\).
Write the linear approximation \(L(\mathbf{y})\) to \(f\) at \(\mathbf{x} = (1, 1)\):
\[L(\mathbf{y}) = f(\mathbf{x}) + \nabla f(\mathbf{x})^T (\mathbf{y} - \mathbf{x})\]Solution
\(f(1,1) = 1 + 2 + 1 = 4\). Then \(L(y_1, y_2) = 4 + 4(y_1 - 1) + 4(y_2 - 1) = 4y_1 + 4y_2 - 4\).
Use the linear approximation \(L(\mathbf{y})\) to estimate \(f(1.1, 0.9)\).
Solution
\(L(1.1, 0.9) = 4(1.1) + 4(0.9) - 4 = 4.4 + 3.6 - 4 = 4\)
Compute the actual value \(f(1.1, 0.9)\).
Solution
\(f(1.1, 0.9) = (1.1)^2 + 2(1.1)(0.9) + (0.9)^2 = 1.21 + 1.98 + 0.81 = 4.00\)
What is the error in the linear approximation? (i.e., \(|f(1.1, 0.9) - L(1.1, 0.9)|\))
Solution
Error \(= |4.00 - 4| = 0.00\)
Compute the Hessian matrix \(\nabla^2 f(\mathbf{x})\) at \(\mathbf{x} = (1, 1)\).
Solution
\(\frac{\partial^2 f}{\partial x_1^2} = 2\), \(\frac{\partial^2 f}{\partial x_1 \partial x_2} = 2\), \(\frac{\partial^2 f}{\partial x_2^2} = 2\), so
\[\begin{split}\nabla^2 f(1,1) = \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix}\end{split}\]For \(\mathbf{y} = (1.1, 0.9)\), compute the (approximate) quadratic error term:
\[E_2(\mathbf{y}) \approx \frac{1}{2}(\mathbf{y} - \mathbf{x})^T \nabla^2 f(\mathbf{x}) (\mathbf{y} - \mathbf{x})\]Solution
\((\mathbf{y} - \mathbf{x}) = (0.1, -0.1)^T\).
\[\begin{split}E_2 = \frac{1}{2}(0.1, -0.1) \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix} \begin{pmatrix} 0.1 \\ -0.1 \end{pmatrix} = \frac{1}{2}(0.1, -0.1) \begin{pmatrix} 0 \\ 0 \end{pmatrix} = 0\end{split}\]For \(\mathbf{y} = (1.1, 1.1)\), compute the (approximate) quadratic error term \(E_2(\mathbf{y})\).
Solution
\((\mathbf{y} - \mathbf{x}) = (0.1, 0.1)^T\).
\[\begin{split}E_2(1.1,1.1) = \frac{1}{2}(0.1,0.1) \begin{pmatrix} 2 & 2 \\ 2 & 2 \end{pmatrix} \begin{pmatrix} 0.1 \\ 0.1 \end{pmatrix} = \frac{1}{2}(0.1,0.1)\begin{pmatrix}0.4\\0.4\end{pmatrix} = 0.04\end{split}\]What does an error \(E_2(\mathbf{y}) = 0\) tell us? What does a non-zero error term tell us? What does the error depend on?
(Hint: desmos.com/3d/esp2pdudke)
Solution
The Hessian has a null space. The direction \((1, -1)\) is an eigenvector with eigenvalue 0, so the curvature vanishes in that direction. Moving along \((0.1, -0.1)\) means moving in a direction where the function has zero curvature, so the quadratic approximation is exact. This shows that the error depends on both the distance and the direction you move.