I am trying to do the following integral:
$$\int_{\pi f}^{3\pi f} dx \sqrt{\cos(x/f)}.$$
Wolfram alpha gives me
$$\int_{\pi f}^{3\pi f} dx \sqrt{\cos(x/f)} = 4f E(2) = 2.39628f + 2.39628if,$$
where E is the elliptic function.
Mathematica also gives me the same answer. How can the integral of a real integrand with real limits be complex?
Consider the problem of the antiderivative $$I=\int \sqrt{\cos \left(\frac{x}{f}\right)}\,dx=f\int \sqrt{\cos \left(y\right)}\,dy=2 f \,E\left(\left.\frac{y}{2}\right|2\right)$$ The problem is that $E(z|2)$ has real values only $-\frac \pi 4 \leq z \leq \frac \pi 4$.