I've been playing around with elliptic integrals lately and I came across Legendre's relation, relating the complete integrals of the first and second kind, $K(k)$ and $E(k)$ respectively:
$E(k)K(\sqrt{1-k^{2}})+E(\sqrt{1-k^{2}})K(k)-K(k)K(\sqrt{1-k^2})=\frac{\pi}{2}$.
To verify this, I tried plotting the left hand relation with respect to $k\in[0,1]$ in Mathematica and found that this only seems to be true at the boundaries! What gives? There seems to be quite a lot of literature on the mathematical proof of the relation, so I'm inclined to think this fault is on Mathematica's end. Does anyone know? Thanks in advance for your help.
Here's the code if you want to have a play yourself:
Plot[{EllipticE[k]*EllipticK[Sqrt[1 - k^2]] + EllipticE[Sqrt[1 -k^2]]*EllipticK[k] - EllipticK[k]*EllipticK[Sqrt[1 - k^2]], Pi/2}, {k, 0, 1}, AxesLabel -> {k}]