Ask Your Question

Revision history [back]

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?

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?