JuliaSymbolics / Symbolics.jl

Symbolic programming for the next generation of numerical software

Home Page:https://symbolics.juliasymbolics.org/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing function to `derivative` results in zero

kapple19 opened this issue · comments

Not sure if this is a bug, but I think this should either throw an error or be fixed.

Setup:

using Symbolics: derivative
f(x) = x^2
@variables x

and then

derivative(f, x)

gives 0,

derivative(f(x), x)

gives Num(2x).

The former should error or be fixed, right?

Yes, we should make it error on non-Num or BasicSymbolic