Evaluate partial derivative
I have a function B(x,y)
and I have an expression f
in which this function appears.
B(x, y) = function('B')(x, y)
f = B(v_m, v)*theta/(B(v_m,v) + theta)
g = f.diff(v_m)
I now have an expression, g
, which involves the partial derivative of B
w.r.t v_m
, and I would like to evaluate this entire expression, including the partial derivative, at v_m == v
.
I can do g.substitute(v_m == v)
or at(g, v_m == v)
but both of these just change the expression to give me the partial derivative of B
with respect to v
, which is not what I want.
Do I need to explicitly define that the partial derivative is a function somehow? I would like to be able to use this expression I have containing the partial derivative and evaluate it as if it is a function, where the output contains the value of the derivative of B
w.r.t. v_m
, evaluated at the input, in the context of the rest of the expression evaluated at that input.
In other words, in the latex representation, I'd like the notation to preserve the expression of the partial derivative and then have the vertical bar on the right hand side to indicate it's being evaluated at a particular point, or in this case, another variable. Here is the latex representation that I'm looking for, for the part of the expression involving the partial derivative:
$$ \frac{\partial}{\partial v_{m}}B\left(v_{m}, v\right) \Bigr\rvert_{v_m = v} $$
Welcome to Ask Sage!
Thank you for your question!
Please provide an explicit example of
B(x, y)
that can be copy-pasted in a fresh Sage session to explore the question.@jgroh
Indeed, there are some MathJax problems at Ask Sage. Thanks for calling attention on this one.
To fix the LaTeX on Ask Sage, replace
\
by\\
, so type\\frac
instead of\frac
etc.