# Automatic differentiation for higher-order derivatives

**URL:** <https://discourse.julialang.org/t/automatic-differentiation-for-higher-order-derivatives/62337>\
**Category:** General Usage\
**Tags:** forwarddiff\
**Created:** [June 3, 2021, 2:33pm UTC](https://discourse.julialang.org/t/automatic-differentiation-for-higher-order-derivatives/62337 "2021-06-03T14:33:12Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [June 4, 2021, 4:12am UTC](https://discourse.julialang.org/t/automatic-differentiation-for-higher-order-derivatives/62337/9 "2021-06-04T04:12:31Z")

</div>

Inspired by you, I wrote a code:

```julia
    if auto_diff
        _funcs = Function[x_cmd_func]
        for i in 1:d+1
            push!(_funcs, (t) -> ForwardDiff.derivative(_funcs[i], t))
        end
    end
    funcs(t) = [_func(t) for _func in _funcs]

```

---

_[View the full topic](https://discourse.julialang.org/t/automatic-differentiation-for-higher-order-derivatives/62337)._
