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
What is the derivative of x with respect to 2x? 1/2 is a great answer. An error is good too. 0 is wrong.
julia>@variables x;
help?> Symbolics.derivative
derivative(O, v; simplify)
A helper functionfor computing the derivative of an expression with respect to var.
julia> Symbolics.derivative(2x, x) # correct2
julia> Symbolics.derivative(x, 2x) # weird input, and wrong answer0
This can be reproduces using only exported names with docstrings
help?> Differential
search: Differential
struct Differential <:Symbolics.Operator
Represents a differential operator.
Fields
≡≡≡≡≡≡
• x: The variable or expression to differentiate with respect to.
Examples
≡≡≡≡≡≡≡≡
julia>using Symbolics
julia>@variables x y;
julia> D =Differential(x)
(D'~x)
julia>D(y) # Differentiate y wrt. x
(D'~x)(y)
julia> Dx =Differential(x) *Differential(y) # d^2/dxy operator
(D'~x(t)) ∘ (D'~y(t))
julia> D3 =Differential(x)^3# 3rd order differential operator
(D'~x(t)) ∘ (D'~x(t)) ∘ (D'~x(t))
help?> expand_derivatives
search: expand_derivatives
expand_derivatives(O; ...)
expand_derivatives(O, simplify; occurrences)
TODO
Examples
≡≡≡≡≡≡≡≡
julia>@variables x y z k;
julia> f=k*(abs(x-y)/y-z)^2
k*((abs(x - y) / y - z)^2)
julia> Dx=Differential(x) # Differentiate wrt x
(::Differential) (generic function with 2 methods)
julia> dfx=expand_derivatives(Dx(f))
(k*((2abs(x - y)) / y -2z)*IfElse.ifelse(signbit(x - y), -1, 1)) / y
julia>expand_derivatives(Differential(2x)(x))
0
The text was updated successfully, but these errors were encountered:
What is the derivative of
x
with respect to2x
? 1/2 is a great answer. An error is good too. 0 is wrong.This can be reproduces using only exported names with docstrings
The text was updated successfully, but these errors were encountered: