Just two general remarks:
- if you post code snippets, please enclose them in triple backticks (```) for better readability
- there is not only numeric and symbolic differentiation, but also automated differentiation which is more common in Julia code. Is that something you could use?
You could also look at: Derivatives and Differentials · Symbolics.jl , but this library is not as mature as SymPy …