Can wolfram alpha compute symbolic vector derivatives

1.1k Views Asked by At

Can Wolfram alpha be used to find out say $$\nabla_x\left(\|y-Ax\|_2\right)$$ What command do I use? I tried some obvious ways, and googled a bit, but didn't find anything.

1

There are 1 best solutions below

1
On

I don't know about Wolfram alpa, but for your example here is the derivative:

$$\nabla_x\|y-Ax\|_2=\frac{\partial}{\partial x} \sqrt{(y-Ax)^T(y-Ax)}$$

$$=\frac{1}{2\|y-Ax\|_2}\frac{\partial}{\partial x} (y-Ax)^T(y-Ax)$$

$$=\frac{1}{2\|y-Ax\|_2}(2A^TAx-2A^Ty)$$

$$=\frac{A^TAx-A^Ty}{\|y-Ax\|_2}$$

Note that the derivative does not exist at $Ax=y$, and therefore the function $\|y-Ax\|_2$ is known to be non-differentiable in its domain.