I’m playing around with using Julia for some perturbation problems and am wanting to be able to take derivatives of series expansions. However, I have been unable to get the chain rule to properly apply. I’m pretty new, so maybe I’m doing something wrong.
using Symbolics
@variables t ϵ T(t) y(T)[0:1]
y_series = series(y, ϵ)
D = Differential(t)
y1_series = D(y_series)
expand_derivatives(y1_series)
\begin{equation}
\frac{\mathrm{d} y\left( T\left( t \right) \right)_{0}}{\mathrm{d}t} + \frac{\mathrm{d} y\left( T\left( t \right) \right)_{1}}{\mathrm{d}t} \epsilon
\end{equation}
This is compared to something like:
@variables x(T)
x_dot = D(x)
expand_derivatives(x_dot)
\begin{equation}
\frac{\mathrm{d} x\left( T\left( t \right) \right)}{T\left( t \right)} \frac{\mathrm{d} T\left( t \right)}{\mathrm{d}t}
\end{equation}
I’m using Julia 1.11.1 with Symbolics