I am trying to calculate/plot the derivative of the second Jacobi theta function $d\theta_2(0, e^{-\pi t} )/dt$.
Calculating or plotting the function itself works fine:
In[1]:= theta2[t_] := EllipticTheta[2, 0, Exp[-1*Pi*t]];
theta2[.8]
Out[2]= 1.07398
with the result being real - as expected from Mathematica's definition:
However, when I try to calculate derivatives of the above, I get a significant imaginary part:
In[3]:= dtheta2[t_] = D[EllipticTheta[2, 0, Exp[-1*Pi^2 *t]], t];
dtheta2[.8]
Out[4]= -0.794774 + 0.280078 I
(Using Set
(=) rather than SetDelayed
(:=) as discussed. Taking the derivative of theta2[t]
instead does not seem to make a difference).
Any ideas what might be going on?
(Note, the branch cut is taken from 0 to -1, so should not be an issue.)