Higher derivative gives NAN

please first read :
Please read: make it easier to help you

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:

    • Re(f(x)) = h(x)
  2. Imaginary Part:

    • Im(f(x)) = q(x)

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

  • The derivative of f(x) is:

    • d/dx [f(x)] = d/dx [h(x) + i * q(x)] = dh(x)/dx + i * dq(x)/dx
  • Separating the derivative into real and imaginary parts:

    • d/dx [f(x)] = dh(x)/dx + i * dq(x)/dx

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.