Quick question on taking the gradient of a 3-variable function defined by norm

17 Views Asked by At

Let $g(x) : \mathbb{R}^3 \to \mathbb{R}^2$, and $c = (c_1,c_2)$.

We define $f(x) = ||c - g(x)||^2$, mapping from $\mathbb{R}^3 \to \mathbb{R}^2$. How do we find $\nabla f$(x)?

1

There are 1 best solutions below

0
On BEST ANSWER

Chain rule, bearing in mind that if $Df(x):\Bbb R^3\to \Bbb R$ is the total derivative of $f$ (a linear map), then $\nabla f(x)$ is the unique vector in $\Bbb R^3$ with $Df(x)(v) = \langle \nabla f(x),v\rangle$, and $Dg(x):\Bbb R^3 \to \Bbb R^2$ is the linear map whose matrix relative to the standard bases of $\Bbb R^3$ and $\Bbb R^2$ is the Jacobian of $g$, we have $$f(x) = \|g(x)-c\|^2 \implies Df(x)(v) = 2\langle g(x)-c, Dg(x)(v)\rangle = \langle Dg(x)^*(g(x)-c),v\rangle,$$where $Dg(x)^*:\Bbb R^2 \to \Bbb R^3$ is the adjoint of $Dg(x)$, represented by the transpose of the Jacobian of $g$. This means that $$\nabla f(x) = Dg(x)^*(g(x)-c).$$In words, the gradient of $f$ at $x$ is obtained by multiplying the transpose of the Jacobian of $g$ at $x$ (a $3\times 2$ matrix) by the column vector $g(x)-c$ (a $2\times 1$ matrix) --- the result is a column vector ($3\times 1$ matrix), as expected.