Elliptical Integral: Finding $I= \int \sqrt{1-k^2\sin^2(x)} \cos^2(x) dx $ Just a sidenote: The part where I am stuck on is at the very end , this is a long question so bear with me until I get to the last part!


Question 1: Two famous integrals are $F= \int \frac{dx}{\sqrt{1-k^2\sin^2(x)}}$ and $E= \int \sqrt{1-k^2\sin^2(x)} dx$ , $k<1$ They are called elliptic integrals of the first
    and second kind respectively. (There is a third type we will not consider.) If an integral can be reduced to a function together with a combination of integrals of this type it is called an
    elliptic integral. It is know that elliptic integrals cannot be integrated exactly.
Defining $\zeta$ by $\zeta (x)= \sqrt{1-k^2\sin^2(x)}$, we have $F = \int \frac{dx}{\zeta}$ , $E = \int \zeta dx $
The problem is to show that $I= \int \sqrt{1-k^2\sin^2(x)} \cos^2(x) dx $ is an elliptic function by showing it can be expressed in terms of elliptic integrals of the first and second kind.

(i) Find $\frac{d \zeta}{dx}$ expressing your answer in terms of $\sin(x)$. $\cos(x)$ in the numerator and $\zeta$ in the denominator.

Let $\zeta(x) = \sqrt{1-k^2\sin^2(x)} = (1-k^2\sin^2(x))^{\frac{1}{2}}$ 
Then $\zeta'(x) = \frac{1}{2} (1-k^2\sin^2(x))^{\frac{-1}{2}} \cdot  -2k^2 \sin(x)\cos(x) \implies \frac{-k^2\sin(x)\cos(x)}{\zeta}$

(ii) Differentiate $\sin(x)\cos(x) \zeta$, bringing your answer to a common denominator of $\zeta$.

Let $p(x) = \sin(x)\cos(x) \sqrt{1-k^2\sin^2(x)} = 0.5\sin(2x)(1-k^2\sin^2(x))^{\frac{1}{2}}$
Then $p'(x) = \cos(2x)(1-k^2\sin^2(x))^{\frac{1}{2}} + 0.5\sin(2x)(\frac{1}{2} (1-k^2\sin^2(x))^{\frac{-1}{2}} \cdot  -2k^2 \sin(x)\cos(x))$
$ \Leftrightarrow (\cos^2(x)-\sin^2(x))\zeta + \frac{(\sin(x)\cos(x))-k^2\sin(x)\cos(x)}{\zeta} $
$ \Leftrightarrow \frac{(\cos^2(x)-\sin^2(x))\zeta^2-k^2\sin^2(x)\cos^2(x)}{\zeta} $

(iii) By setting $v=\sin^2(x)$ and using this to replace all occurrences of $\zeta^2$ and $\cos^2(x)$ as well show that
$$ \frac{d(\sin(x)\cos(x)\zeta)}{dx} = \frac{1}{\zeta} \left[1-2v(k^2+1)v+3k^2v^2 \right]$$
Hence $\sin(x)\cos(x)\zeta = \int \frac{dx}{\zeta} - 2(k^2+1)\int \frac{vdx}{\zeta} + 3k^2 \int \frac{v^2dx}{\zeta}$

From part(ii) we have that $\frac{d(\sin(x)\cos(x)\zeta)}{dx} = \frac{(\cos^2(x)-\sin^2(x))\zeta^2-k^2\sin^2(x)\cos^2(x)}{\zeta} $
Since $v=\sin^2(x)$ it implies that $1-v=\cos^2(x)$ so
$$\frac{d(\sin(x)\cos(x)\zeta)}{dx} = \frac{(1-2v)(1-k^2v)-k^2v(1-v)}{\zeta} $$
$$ \Leftrightarrow \frac{d(\sin(x)\cos(x)\zeta)}{dx} = \frac{1}{\zeta} (1+3k^2v^2-2k^2v-2v) $$
$$  \therefore \frac{d(\sin(x)\cos(x)\zeta)}{dx} = \frac{1}{\zeta} \left[1-2v(k^2+1)+3k^2v^2 \right] $$
and if we integrate bothsides we get 
$$ \sin(x)\cos(x)\zeta = \int \frac{dx}{\zeta} - 2(k^2+1)\int \frac{vdx}{\zeta} + 3k^2 \int \frac{v^2dx}{\zeta}$$
Now this part of the question is where I get stuck from

(iv) Show that $$I= \frac{1}{3} \zeta \sin(x)\cos(x) + \frac{1+k^2}{3k^2}E - \frac{1-k^2}{3k^2}F$$

How would I do this?


$$A:=k^2\int\frac{v^2}{\zeta}\;dx$$

$$
\zeta^2=1-k^2v\implies k^4v^2=(1-\zeta^2)^2\\
\begin{align}
\therefore k^2A&=\int\frac{1}{\zeta}\;dx-2\int{\zeta}\;dx+\int\zeta^3\;dx\\
&=F-2E+\int\zeta(1-k^2v)dx\\
&=F-E-k^2\int\zeta v\;dx\\
&=F-E-k^2\int\zeta(1-\cos^2x)\;dx\\
&=F-(1+k^2)E+k^2\int\zeta\cos^2x\;dx\\
&=F-(1+k^2)E+k^2I
\end{align}
$$

$$
B:=\int\frac{v}{\zeta}\;dx
$$

$$\begin{align}
k^2B=\int\frac{1-\zeta^2}{\zeta}\;dx=F-E
\end{align}$$
From $(iii)$ we have
$$\begin{align}
\sin(x)\cos(x)\zeta&=F-2(1+k^2)B+3A\\
&=F-2\frac{1+k^2}{k^2}(F-E)+\frac{3}{k^2}[F-(1+k^2)E+k^2I]
\end{align}$$
which after a little algebraic manipulation yields
$$
I={1\over3}\sin(x)\cos(x)\zeta+\frac{1+k^2}{3k^2}E-\frac{1-k^2}{3k^2}F
$$
