# Symbolics.jl - Retrieving Differential Variables

**URL:** <https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891>\
**Category:** Modelling & Simulations\
**Tags:** question\
**Created:** [July 21, 2025, 2:14am UTC](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891 "2025-07-21T02:14:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gray\_GALLANT](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gray_gallant/32/214253_2.png) [@Gray\_GALLANT](https://discourse.julialang.org/u/Gray_GALLANT)\
**Post date:** [July 21, 2025, 2:14am UTC](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891/1 "2025-07-21T02:14:02Z")

</div>

Is there a way to retrieve differential variables from an expression using Symbolics.jl? For example, if I use `get_variables` on `Differential(t)(x(t))` it only returns `x(t)`, but I need to get the differential part as well so I can substitute it for `diff2term(Differential(t)(x(t))`.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 21, 2025, 8:56am UTC](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891/2 "2025-07-21T08:56:08Z")

</div>

Open an issue. I’m afraid the answer is, yes but it’s harder than it needs to be so let’s just make a function and document it

---

<div class="post-metadata">

**Author:** ![Gray\_GALLANT](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gray_gallant/32/214253_2.png) [@Gray\_GALLANT](https://discourse.julialang.org/u/Gray_GALLANT)\
**Post date:** [July 21, 2025, 8:18pm UTC](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891/3 "2025-07-21T20:18:07Z")

</div>

So far I haven’t found a good string-based method for identifying every differential variable in an expression. I think that a temporary solution will involve using eval(Meta.parse()). My main issue is just that I’ve found it pretty difficult to build a general function that recognizes every differential term in the string of an expression. For specific cases / known variable names there isn’t much of an issue.
