5
$\begingroup$

I have found several questions including this as a step in the explanation, but have not been able to find an explicit explanation of how to take a derivative of a magnitude of a vector.

I am trying to take the derivative d/dt ||r'(t)|| but don't know how to address the magnitude signs.

$\endgroup$
4
  • $\begingroup$ Do you have a formula for $r(t)$ and for $r'(t)$? If so get the formula for $||r'(t)||$ which will be a 1-var function of $t,$ then do derivative of that. $\endgroup$
    – coffeemath
    Commented Jan 4, 2019 at 21:34
  • 1
    $\begingroup$ What is your norm? The one derived from the dot product? $\endgroup$ Commented Jan 4, 2019 at 21:36
  • $\begingroup$ @mathcounterexamples.net r(t) is a path -- what would the norm derived from the dot product be? $\endgroup$
    – icesk8er
    Commented Jan 4, 2019 at 21:44
  • $\begingroup$ If you, like me, came here trying to do machine learning square loss like minimizing $||y-Xw||$^2 by differentiating and setting equal to 0, I don't recommend trying the solutions here. Instead, just use the dot product definition of magnitude to get to $(y-Xw)^T(y-Xw)$, do out the multiplication and then use (84) of the Matrix Cookbook. A tutorial is here $\endgroup$
    – Pro Q
    Commented Sep 14, 2022 at 1:36

3 Answers 3

12
$\begingroup$

I will assume that you are working with the euclidian norm and the dot product. Let $v(t)$ be a vector: $$v(t) \cdot v(t)=|v(t)|^2$$ And $$\frac{\mathrm{d}|v(t)|^2}{\mathrm{d}t}=2|v(t)|\frac{\mathrm{d}|v(t)|}{\mathrm{d}t}$$ Which implies that $$\begin{align} \frac{\mathrm{d}|v(t)|}{\mathrm{d}t}&=\frac{1}{2|v(t)|}\frac{\mathrm{d}|v(t)|^2}{\mathrm{d}t}\\ &=\frac{1}{2|v(t)|}\frac{\mathrm{d}(v(t) \cdot v(t))}{\mathrm{d}t}\\ &=\frac{1}{2|v(t)|}\left(v(t) \cdot v'(t)+v'(t) \cdot v(t)\right)\\ &=\frac{1}{2|v(t)|}\left(2v(t) \cdot v'(t)\right)\\ &=\frac{v(t) \cdot v'(t)}{|v(t)|} \end{align}$$

$\endgroup$
1
  • $\begingroup$ (If anyone is unfamiliar with the notation, $v^\prime(t) = \dot{v}(t) = \frac{d v(t)}{d t}$.) $\endgroup$ Commented Jan 5, 2019 at 16:12
1
$\begingroup$

If the norm is derived from the dot product $\langle \cdot , \cdot \rangle$, then

$$\frac{d\Vert r^\prime(t) \Vert}{dt} = \frac{\langle r^\prime(t),r^{\prime \prime}(t)\rangle}{\Vert r^\prime(t)\Vert}.$$

$\endgroup$
2
  • $\begingroup$ Could you explain how you got that? $\endgroup$
    – icesk8er
    Commented Jan 4, 2019 at 21:52
  • $\begingroup$ Using the chain rule. A more simple way is to use the coordinates and the fact that for a vector $x=(x_1, \dots, x_n)$ (in dimension $n$), you have $\Vert x \Vert = \sqrt{x_1^2 + \dots +x_n^2}$ $\endgroup$ Commented Jan 4, 2019 at 21:56
1
$\begingroup$

$$ \eqalign{ & \left| {r(t)} \right|^2 = r_{\,x} (t)^2 + r_{\,y} (t)^2 + \cdots \cr & 2\left| {r(t)} \right|{d \over {dt}}\left| {r(t)} \right| = 2\left( {r_{\,x} (t)r_{\,x} '(t) + r_{\,y} (t)r_{\,y} '(t) + \cdots } \right) \cr & {d \over {dt}}\left| {r(t)} \right| = {{r_{\,x} (t)r_{\,x} '(t) + r_{\,y} (t)r_{\,y} '(t) + \cdots } \over {\left| {r(t)} \right|}} \cr} $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .