# Derivatives of vectors

I have an issue with derivatives of vectors

$Assumptions := v ∈ Vectors[3, Reals] (*Assuming v is a 3d vector*) D[Norm[v]^2, v.{0, 0, 1}] (*differentiate with respect to third component*)  Output: 0 But isn't this supposed to be:$\frac{\partial (v_1^2+v_2^2+v_3^2)}{\partial v_3}=2v_3$• If my answer below answered your question, please accept it so that we can get this question off the unanswered list and so that I can get those meaningless internet points that I so crave! – march Nov 6 '15 at 4:09 • @march Ah! Yep here are your well-deserved points :) Thanks a lot for the help! I simply forgot to click ;) – Otto Nov 7 '15 at 1:56 ## 1 Answer Here's how you should probably do this: vec = Array[v, 3] D[vec.vec, vec.{0, 0, 1}] (* {v, v, v} *) (* 2 v *)  I'll just make a couple of points about D. • It doesn't behave well when given functions like Abs and Norm: D[Norm[{a, b, c}]^2, a] (* 2 Abs[a] Abs'[a] *)  Instead, you should typically use more explicit forms of vector norms, which is why I used vec.vec (* v^2 + v^2 + v^2 *)  • I would guess that Vectors is mainly useful for doing symbolic tensor math, as shown in the documentation. It's not for what you're trying to do with it. • Meditate on the result of the following evaluation; it will show you why your result was zero and how D interprets its arguments. Clear[v] D[v.{0, 0, 1}, v.{0, 0, 1}]  • I upvoted this even though your rep counter was just at 4444, and now I messed up that nice number. Sorry for that, I guess. – Jens Oct 15 '15 at 5:27 • @Jens I wish I could have stayed there forever.$4444 = 66^2 + 88$;$4444 = 4\times1111$with$1+1+1+1 = 4\$. – march Oct 15 '15 at 15:35
• You are correct that Vectors is meant for symbolic tensor manipulations and simplifications. – Stefan R Oct 16 '15 at 17:22