# Higher derivative gives NAN

**URL:** <https://discourse.julialang.org/t/higher-derivative-gives-nan/116763>\
**Category:** New to Julia\
**Tags:** autodiff\
**Created:** [July 8, 2024, 10:03am UTC](https://discourse.julialang.org/t/higher-derivative-gives-nan/116763 "2024-07-08T10:03:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Maysam\_Gholampour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maysam_gholampour/32/218184_2.png) [@Maysam\_Gholampour](https://discourse.julialang.org/u/Maysam_Gholampour)\
**Post date:** [July 8, 2024, 3:39pm UTC](https://discourse.julialang.org/t/higher-derivative-gives-nan/116763/5 "2024-07-08T15:39:26Z")

</div>

please first read :  
[Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

If x is real, you can simplify f(x) to f(x) = h(x) + i \* q(x), where h(x) and q(x) are real-valued functions, and i is the imaginary unit.

To derive f(x) into its real and imaginary parts separately:

1. **Real Part:**

2. **Imaginary Part:**

When differentiating f(x) with respect to x, and treating the real and imaginary parts separately:

- The derivative of f(x) is:

- Separating the derivative into real and imaginary parts:

Here, dh(x)/dx is the derivative of the real part h(x) with respect to x, and dq(x)/dx is the derivative of the imaginary part q(x) with respect to x.

---

_[View the full topic](https://discourse.julialang.org/t/higher-derivative-gives-nan/116763)._
