Skip to main content

MATH 345: Linear Algebra and Optimization

Section 5.1 Optimization problems and critical points

Subsection Optimization problems

In this unit, we apply multivariate calculus to solve some optimization problems.

Definition 5.1.1. Optimization problems.

Let \(f: \R^n \to \R\) be a scalar-valued function, and consider a set \(U \subseteq \R^n\text{.}\) Then we can consider two optimization problems, in which we call \(f\) the objective function of the problem, and \(U\) the feasible region of the optimization problem:
  • The minimization problem of \(f\) on \(U\) is the problem of finding \(\mathbf{x}^* \in U\) such that the value \(f(\mathbf{x}^*)\) is smallest among all elements of \(U\) (so the function is minimized on \(U\) by \(\mathbf{x}^*\)).
  • The maximization problem of \(f\) on \(U\) is the problem of finding \(\mathbf{x}^* \in U\) such that the value \(f(\mathbf{x}^*)\) is largest among all elements of \(U\) (so the function is maximized on \(U\) by \(\mathbf{x}^*\)).

Example 5.1.2.

A common optimization problem that we have already encountered in DefinitionΒ 4.2.4 involves taking a subspace \(U \subseteq \R^n\) and a given vector \(\mathbf{x}_0 \in \R^n\text{,}\) and finding the vector \(\mathbf{x}^* \in U\) that is closest to \(\mathbf{x}_0\text{,}\) i.e., finding the vector that minimizes the scalar-valued function \(g: \R^n \to \R\) on \(U\text{,}\) defined by setting \(g(\mathbf{x}) = \| \mathbf{x}_0 - \mathbf{x} \| \text{.}\) Then \(\mathbf{x}^*\) is the orthogonal projection of \(\mathbf{x}_0\) onto \(U\text{,}\) and we have seen in TheoremΒ 4.2.6 that if \(U\) has an orthogonal basis \(\{ \mathbf{f}_1, \dots, \mathbf{f}_m \}\text{,}\) then
\begin{equation*} \mathbf{x}^* = \frac{\mathbf{x}_0\cdot\mathbf{f}_1}{\|\mathbf{f}_1\|^2}\mathbf{f}_1 + \frac{\mathbf{x}_0\cdot\mathbf{f}_2}{\|\mathbf{f}_2\|^2}\mathbf{f}_2 + \cdots + \frac{\mathbf{x}_0\cdot\mathbf{f}_m}{\|\mathbf{f}_m\|^2}\mathbf{f}_m\text{.} \end{equation*}
In the section on SectionΒ 5.6, we return to least squares and derive the normal equations by setting a gradient equal to zero.

Note 5.1.3. Unit 4 connection.

In Unit 4, projection was a closest-point problem. If \(W\) is a subspace and \(\mathbf{b}\) is a vector, the projection problem asks for the point \(\hat{\mathbf{b}}\in W\) that minimizes
\begin{equation*} \|\mathbf{b}-\mathbf{w}\| \end{equation*}
over all \(\mathbf{w}\in W\text{.}\) Unit 4 solved this using orthogonality. Unit 5 studies the same kind of question with gradients: minimize a function by looking at how it changes.

Activity 5.1.1. Projection as optimization.

Let
\begin{equation*} W=\operatorname{span}\left\{ \begin{bmatrix} 1\\ 0 \end{bmatrix} \right\} \subseteq \mathbb{R}^2, \qquad \mathbf{b}= \begin{bmatrix} 2\\ 3 \end{bmatrix}. \end{equation*}
A general point of \(W\) has the form
\begin{equation*} \mathbf{w}(t)= \begin{bmatrix} t\\ 0 \end{bmatrix}. \end{equation*}
  1. Write the squared distance \(g(t)=\|\mathbf{b}-\mathbf{w}(t)\|^2\text{.}\)
  2. Minimize \(g(t)\text{.}\)
  3. What point of \(W\) is closest to \(\mathbf{b}\text{?}\)
  4. How does this agree with the projection picture from Unit 4?
Tags. [U5-LO1, U4-LO4 | C+R | Core]
Solution.
We have
\begin{equation*} \mathbf{b}-\mathbf{w}(t)= \begin{bmatrix} 2-t\\ 3 \end{bmatrix}, \end{equation*}
so
\begin{equation*} g(t)=\|\mathbf{b}-\mathbf{w}(t)\|^2=(2-t)^2+9. \end{equation*}
This is minimized when \(t=2\text{.}\) Therefore the closest point in \(W\) is
\begin{equation*} \hat{\mathbf{b}}= \begin{bmatrix} 2\\ 0 \end{bmatrix}. \end{equation*}
This agrees with the Unit 4 projection picture: the residual
\begin{equation*} \mathbf{b}-\hat{\mathbf{b}}= \begin{bmatrix} 0\\ 3 \end{bmatrix} \end{equation*}
is orthogonal to \(W\text{.}\)

Subsection Critical points

Definition 5.1.4. Minima and maxima.

Suppose \(f\) is a scalar-valued function. A point \(\mathbf{a}\) in the domain of \(f\) is a
  • local minimum if there is a ball centered at \(\mathbf{a}\) such that \(f(\mathbf{a}) \leq f(\mathbf{x})\) whenever \(\mathbf{x}\) is in that ball, and also in the domain of \(f\text{.}\) In this case, we say \(f(\mathbf{a})\) is a local minimum value for the function \(f\text{.}\)
  • local maximum if there is a ball centered at \(\mathbf{a}\) such that \(f(\mathbf{a}) \geq f(\mathbf{x})\) whenever \(\mathbf{x}\) is in that ball, and also in the domain of \(f\text{.}\) In this case, we say \(f(\mathbf{a})\) is a local maximum value for the function \(f\text{.}\)
  • global minimum if \(f(\mathbf{a}) \leq f(\mathbf{x})\) for all \(\mathbf{x}\) in the domain of \(f\text{.}\) In this case, \(f(\mathbf{a})\) is the global minimum value, or absolute minimum value, of the function \(f\text{.}\)
  • global maximum if \(f(\mathbf{a}) \geq f(\mathbf{x})\) for all \(\mathbf{x}\) in the domain of \(f\text{.}\) In this case, \(f(\mathbf{a})\) is the global maximum value, or absolute maximum value, of the function \(f\text{.}\)
A local minimum or local maximum is also called a local extremum.

Remark 5.1.5.

The graph of the function \(-f\) is obtained by reflecting the graph of the function \(f\) in the output axis. This operation turns local and global maxima into local and global minima, and vice versa. So methods for finding minima for a general function often give methods for finding maxima, which makes the two problems often equivalent.

Definition 5.1.6. Critical points.

Suppose \(f\) is a scalar-valued function that is differentiable at a point \(\mathbf{a}\text{.}\) Then we say \(\mathbf{a}\) is a critical point if \(\nabla f(\mathbf{a}) = \mathbf{0}\text{.}\)
For a scalar-valued function \(f(x,y)\text{,}\) a critical point is a solution to the two equations \(f_x(x,y) = 0\) and \(f_y(x,y) = 0\text{.}\)
Just as the derivative of a scalar-valued function of a single variable helps identify local minima and maxima, partial derivatives provide information about possible local minima/maxima.

Activity 5.1.2.

Find the critical points of the function
\begin{equation*} f(x,y) = x^2 + y^2 - 2x + 4y\text{.} \end{equation*}
Solution.
To find the critical points, we calculate the partial derivatives and set them equal to zero. We find that
\begin{equation*} f_x(x,y) = 2x - 2 \quad\text{and}\quad f_y(x,y) = 2y + 4\text{.} \end{equation*}
The critical points are the pairs \((x,y)\) that simultaneously solve the equations \(2x - 2 = 0\) and \(2y + 4 = 0\text{.}\) So the only critical point is \((1, -2)\text{.}\)

Activity 5.1.3.

Find the critical points of \(f(x,y) = x^2 - y^2\text{.}\)
Solution.
We compute that \(f_x(x,y) = 2x\) and \(f_y(x,y) = -2y\text{.}\) The only \((x,y)\) such that \(f_x(x,y) = 2x = 0\) and \(f_y(x,y) = -2y = 0\) is \((0,0)\text{.}\) This is the only critical point.