Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you do g(v_m=v) or g.subs(v_m=v) I think you get the correct answer:

$\frac{\theta D_{0}\left(B\right)\left(v, v\right)}{\theta + B\left(v, v\right)} - \frac{\theta B\left(v, v\right) D_{0}\left(B\right)\left(v, v\right)}{{\left(\theta + B\left(v, v\right)\right)}^{2}}$

$D_0(B)$ is the partial derivative of B with respect to the first argument ($v_m$ in your case), and this partial derivative is then evaluated at $(v,v)$.

If all you want to do is change the appearance of the partial derivative, you can do it by substituting another variable, for which you specify the latex representation:

D = sage.symbolic.operators.FDerivativeOperator
dB = var('dB', latex_name=r'{\frac{\partial B(v_m, v)}{\partial v_m}}_{|v_m=v}')
g(v_m=v).subs({D(B, [0])(v, v): dB})

Result:

$\frac{{{\frac{\partial}{\partial v_m}} B(v_m, v)_{|v_m=v}} \theta}{\theta + B\left(v, v\right)} - \frac{{{\frac{\partial}{\partial v_m}} B(v_m, v)_{|v_m=v}} \theta B\left(v, v\right)}{{\left(\theta + B\left(v, v\right)\right)}^{2}}$