# Worksheet 1-3

Download: [CMSE382-WS1-3.pdf](CMSE382-WS1-3.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.

1. $S_1 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 < 1\}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

2. $S_2 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 \leq 1\}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

3. $S_3 = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 = 1\}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

4. $S_4 = [0, 1) \subset \mathbb{R}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

5. $S_5 = (0, 1) \cup (2, 3) \subset \mathbb{R}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

6. $S_6 = [0, 1] \cup [2, 3] \subset \mathbb{R}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

7. $S_7 = \{(x,y) \in \mathbb{R}^2 \colon x \geq 0, y\geq 1 \}$

   Open &emsp; Closed &emsp; Bounded &emsp; Compact

---

## Worksheet 1-3: Q2

1. Find the gradient for the scalar-valued function $f(x,y,z)=x^4 + 3yz$ at $(1,2,3)$.

2. 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)$.

3. Find the Hessian for $f$ at $\mathbf{x}=(1,2,3)$.

---

## 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)$.

1. Compute $\nabla f(\mathbf{x})$ at $\mathbf{x} = (1, 1)$.

2. 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})$$

3. Use the linear approximation $L(\mathbf{y})$ to estimate $f(1.1, 0.9)$.

4. Compute the actual value $f(1.1, 0.9)$.

5. What is the error in the linear approximation? (i.e., $|f(1.1, 0.9) - L(1.1, 0.9)|$)

6. Compute the Hessian matrix $\nabla^2 f(\mathbf{x})$ at $\mathbf{x} = (1, 1)$.

7. 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})$$

8. For $\mathbf{y} = (1.1, 1.1)$, compute the (approximate) quadratic error term $E_2(\mathbf{y})$.

9. 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](https://www.desmos.com/3d/esp2pdudke))*
