I want evaluate the follow integral $$\displaystyle \int_{0}^{K} \text{sn}^4(u;k)\;\text{du},\tag{1}$$ where $\text{sn}$ is the Jacobi Elliptic snoidal function and $K:=K(k)$ is the complete elliptic integral of the first kind and number $k \in \left(0,1\right)$ is called the modulus.
On the one hand by the identity $310.04$ of $[1]$ we have that $$\int \text{sn}^4(u;k)\;\text{du}=\frac{1}{3k^4}\bigg[(2+k^2)u-2(1+k^2)E(u)+k^2\text{sn}(u;k)\text{cn}(u;k)\text{dn}(u;k)\bigg]\tag{2},$$ where $\text{cn}$ and $\text{dn}$ is the Jacobi Elliptic cnoidal and dnoidal functions and $E(k)$ is the complete elliptic integral. Thus, in order to calculate $(1)$ it would be enough for me to calculate $$\frac{1}{3k^4}\bigg[(2+k^2)u-2(1+k^2)E(u)+k^2\text{sn}(u;k)\text{cn}(u;k)\text{dn}(u;k)\bigg]\Bigg|_{0}^{K}\tag{3},$$ that is, $$\frac{1}{3k^4}\bigg[(2+k^2)K(k)-2(1+k^2)E(k)+2(1+k^2)E(0)\bigg],\tag{4}$$ where $E(K(k))=E(k)$ and by the formula $111.02$ of $[1]$, $E(0)=\frac{\pi}{2}$.
On the other hand, I know that $(1)$ is equal to $$\frac{1}{3k^4}\bigg[(2+k^2)K(k)-2(1+k^2)E(k)\bigg].\tag{5}$$
Question. What is the error in my calculation in $(4)$? Because it is different from $(5)$.
[1] P. F. Byrd. M. D. Friedman. Hand Book of Elliptical Integrals for Engineers and Scientis. Springer-Verlag New York Heidelberg Berlim, $1971$.
The cause is a clash of notations for $E(k)$, the complete integral [in $(4)$], and $E(u):=E(\operatorname{am}(u,k);k)$, the incomplete integral [in $(3)$], introduced in $310.02$. We're substituting [$u=K$ and] $u=0$ in $(3)$, thus $E(0)$ in $(4)$ has the latter meaning, and is equal to $0$, not $\pi/2$.