Is there a shortcut to construct derivatives of a product using Symbolics?

This is a rather basic question, as I’ve just started using Symbolics.jl and couldn’t find this in the docs after a brief glance. What I want to do is evaluate f -> (d/dx)(x * f). I have figured out one way to achieve this:

julia> @variables x
1-element Vector{Num}:
 x

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

julia> f = y -> D(x*y)
#1 (generic function with 1 method)

julia> f(x)
Differential(x)(x^2)

julia> expand_derivatives(f(x))
2x

julia> expand_derivatives(f(x^3))
4(x^3)

I was wondering if there’s a short-cut to construct this operator? Initially, I had assumed that it’ll be something like

julia> D * x
Differential(x) ∘ x

but this doesn’t seem to be what I’m after:

julia> (D * x)(x)
ERROR: Sym x is not callable. Use @syms x(var1, var2,...) to create it as a callable.

I don’t think there’s a shortcut. What you showed is a good way to do that, and you can just define a Julia function that creates that if you’re using it a lot.