# Chain rule not working as expected with Symbolic series

**URL:** <https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598>\
**Category:** General Usage\
**Tags:** symbolics\
**Created:** [December 8, 2024, 10:43pm UTC](https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598 "2024-12-08T22:43:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![willrae42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/willrae42/32/214018_2.png) [@willrae42](https://discourse.julialang.org/u/willrae42)\
**Post date:** [December 8, 2024, 10:43pm UTC](https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598/1 "2024-12-08T22:43:32Z")

</div>

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.

```julia
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:

```julia
@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

---

<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:** [December 9, 2024, 8:45am UTC](https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598/2 "2024-12-09T08:45:32Z")

</div>

Open an issue.
