I have
gamma=var('gamma', latex_name=r'\gamma')
m = function('m')(r)
V=function('V')(r)
phi=gamma*m(r)/r
divG = (diff(diff(phi,r),r)+2/r*diff(phi,r)).full_simplify()
which describes a spherical symmetric source term of a field. Now I want to get this as a function of volume, not of radius and tried:
V(r)=4*pi*r^3/3
a=divG.subs(r=V(r))
b=divG.substitute_function(r,V(r))
I expect the term to be 12piV*d²/dV²m(V), but neither a or b seem to get me near that result. Obviously I am missing something basic.