1 | initial version |

Permit me to ask this another way. I want to compute the symbolic gradient of the following:

-mu * x / r^3, where mu is a constant and r = sqrt( x^2 + y^2 + z^2 )

In my sage worksheet I have:

variables = var( 'x, y, z, r, f' ) constants = var( 'm' ) r = sqrt( x^2 + y^2 + z^2 ) f = -m * x / r^3 show(f.gradient([x,y,z]))

Sage does not give me the correct answer. My question is how do I get Sage to treat or declare m as a constant in the calculus sense?

2 | No.2 Revision |

Permit me to ask this another way. I want to compute the symbolic gradient of the following:

-mu * x / r^3, where mu is a constant and r = sqrt( x^2 + y^2 + z^2 )

In my sage worksheet I have:

variables = var( 'x, y, z, r, f' ~~)
~~)

constants = var( 'm' ~~)
~~)

r = sqrt( x^2 + y^2 + z^2 ~~)
~~)

f = -m * x / ~~r^3
~~r^3

show(f.gradient([x,y,z]))

Sage does not give me the correct answer. My question is how do I get Sage to treat or declare m as a constant in the calculus sense?

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.