I’m looking to take the derivative of the following function:
a = -mu/r^3 rvec
with respect to rvec. Where rvec is in R3 and r is the norm of rvec. I know the solution is
mu/r^3 [3 rhat rhat^T - I ]
where rhat is the unit vector of rvec, ^T is the transpose and I is a 3x3 identity matrix. How would I do this using mathematica though? Thanks in advance!
As far as I know Mathematica does not have this functionality readily built-in. But you can program these definitions from e.g. Matrix calculus - Wikipedia
For example, the operators Del does not have a built-in meaning, but you can add one yourself.
Thanks for your response, this is what I was looking for. Now to take it one step further. Is it possible to get res1 into the following matrix form mu/r^3 [3 rhat rhat^T - I ] from components? This is of course the solution, and normally that wouldn’t be known beforehand.
By components I mean the solution is given in terms of r1, r2 and r3. Is there a way to get it into vector format. Essentially is there a way to take the derivative of a = -mu/r^3 rvec and get mu/r^3 [3 rhat rhat^T - I ] out, in exactly this form? Currently I’m doing the derivative by hand in vector form, and your answer allows me to check whether I did it right or not. But this was only the first derivative, I need to go up to the 6th so doing this by hand would take a while … if mathematica could immediately provide a vector solution that’d be great. I’ve been looking into the package VEST, but haven’t figured out how to use it properly.