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

`Differential`s display differently in a REPL than their docstring indicates they should

LilithHafner opened this issue · comments

From the docstring,

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)

But in a REPL, I get a different result

julia> using Symbolics

julia> @variables x y;

julia> D = Differential(x)
(::Differential) (generic function with 3 methods)

julia> D(y) # Differentiate y wrt. x
Differential(x)(y)

julia> Dx = Differential(x) * Differential(y) # d^2/dxy operator
Differential(x)  Differential(y)

julia> D3 = Differential(x)^3 # 3rd order differential operator
Differential(x)  (Differential(x)  Differential(x))

Strangely, the REPL docstring example is a doctest. I'm happy to change the docstring and/or the show behavior so that these align.

The docstring is just really old. Interesting the doctest doesn't fail.