You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Derivative expressed as Derivative(f(x), (x, x)) the choice of x for wrt and count is allowed but the substitution of x with a value should proceed (I think) along the lines of treating the wrt variable as a bound symbol and the count as a free symbol, so (x**2).diff((x,x)) == Subs((y**2).diff((y, x)), y, x).
When you substitution x->2 you should get the 2nd derivative evaluated at 2. The _eval_subs method of Derivative should sort out the details. I think the following (rather than an error) should be obtained:
It's confusing because in SymPy we have to use a variable name to indicate differentiation.
SymPy's f(x).diff(x,1) can normally be written as f'(x) with only a single x. Then I can write something like f'(1) and f''(2) and f'''(3). More generally I can write f^n(n) but the way to write that in SymPy would be f(n).diff(n, n).
It means the same thing as Subs(Derivative(f(y), (y, x)), y, x) e.g. f(x).diff(x,x).subs(x,2) -> f(x).diff(x, 2).subs(x, 2). So if f(x) == x**3 then the answer is 12.
In a Derivative expressed as
Derivative(f(x), (x, x))
the choice ofx
for wrt and count is allowed but the substitution of x with a value should proceed (I think) along the lines of treating the wrt variable as a bound symbol and the count as a free symbol, so(x**2).diff((x,x)) == Subs((y**2).diff((y, x)), y, x)
.When you substitution
x->2
you should get the 2nd derivative evaluated at 2. The_eval_subs
method of Derivative should sort out the details. I think the following (rather than an error) should be obtained:The text was updated successfully, but these errors were encountered: