# Custom function derivative for JuMP

**URL:** <https://discourse.julialang.org/t/custom-function-derivative-for-jump/17966>\
**Category:** General Usage\
**Created:** [November 25, 2018, 12:55am UTC](https://discourse.julialang.org/t/custom-function-derivative-for-jump/17966 "2018-11-25T00:55:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [November 25, 2018, 12:55am UTC](https://discourse.julialang.org/t/custom-function-derivative-for-jump/17966/1 "2018-11-25T00:55:23Z")

</div>

I have a function not supported out of the box by autodiff, and looking for ways to specify its derivative manually. Specifically, in my case it is a fourier transform from NFFT.jl, so it is possible to differentiate efficiently. Surprisingly, I could not find anything related to custom differentiable functions in the docs. Any suggestions?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 25, 2018, 2:24am UTC](https://discourse.julialang.org/t/custom-function-derivative-for-jump/17966/2 "2018-11-25T02:24:27Z")

</div>

Take a look at the section on user-defined functions in the JuMP docs:  
[http://www.juliaopt.org/JuMP.jl/0.18/nlp.html#user-defined-functions](http://www.juliaopt.org/JuMP.jl/0.18/nlp.html#user-defined-functions)

It includes an example where the derivatives are supplied manually.
