Proving an identity involving differentials of integrals 
Define $$ E(\theta,k) = \int_0^\theta \sqrt{1-k^2\sin{^2{x}}} dx$$ and $$F(\theta,k) = \int_0^\theta \frac{1}{\sqrt{1-k^2\sin{^2{x}}}} dx$$ We are to show $$\left(\frac{\partial E}{\partial k}\right)_\theta = \frac{E-F}{k} $$

Am I right in thinking: $$\left(\frac{\partial E}{\partial k}\right)_\theta =\int_0^\theta \frac{\partial}{\partial k}\sqrt{1-k^2\sin{^2{x}}} dx $$
Which gives $$k\left[\int_0^\theta \frac{\cos^2{x}}{\sqrt{1-k^2\sin{^2{x}}}} dx - \int_0^\theta \frac{1}{\sqrt{1-k^2\sin{^2{x}}}} dx\right]$$
which is $$k\left[\int_0^\theta \frac{\cos^2{x}}{\sqrt{1-k^2\sin{^2{x}}}} dx -F\right]$$
However, I can't seem to reduce the left integral to give what is required. Many thanks in advance.
 A: Use your first lethal weapon (i.e adding and subtracting one):
$$
\begin{aligned}
\frac{d}{dk}\sqrt{1-k^2\sin^2x}&=-\frac{k\sin^2x}{\sqrt{1-k^2\sin^2x}}\\
&=\frac{1}{k}\frac{1-k^2\sin^2x-1}{\sqrt{1-k^2\sin^2x}}\\
&=\frac{1}{k}\biggl(\sqrt{1-k^2\sin^2x}-\frac{1}{\sqrt{1-k^2\sin^2x}}\biggr)
\end{aligned}
$$
A: Starting from your correct assumption
$$\left(\frac{\partial E}{\partial k}\right)_\theta =\int_0^\theta \frac{\partial}{\partial k}\sqrt{1-k^2\sin{^2{x}}}\ dx$$
the differential, however, evaluates to
$$\begin{align}\left(\frac{\partial E}{\partial k}\right)_\theta &=\int_0^\theta \frac{-k\sin^2\theta}{\sqrt{1-k^2\sin{^2{x}}}}\ dx\\&=\frac{1}{k}\int_0^\theta \frac{-k^2\sin^2\theta}{\sqrt{1-k^2\sin{^2{x}}}}\ dx\\&=\frac{1}{k}\int_0^\theta \frac{1-k^2\sin^2\theta-1}{\sqrt{1-k^2\sin{^2{x}}}}\ dx\\&=\frac{1}{k}\left(\int_0^\theta \sqrt{1-k^2\sin{^2{x}}}\ dx-\int_0^\theta \frac{1}{\sqrt{1-k^2\sin{^2{x}}}}\ dx\right)\\&=\frac{E-F}{k}\end{align}$$
A: The calculation of $\left(\frac{\partial E}{\partial k}\right)_{\theta}$ is fine, although you may not want to use $-\sin^2 x = \cos^2 x - 1$.  Instead, calculate $\frac{E-F}{k}$ directly by combining the integrals and simplifying.
