Help me prove $K(k) = \frac{1}{1+k}K\left(\frac{2\sqrt{k}}{1+k}\right)$ where $K(k) = \int^{\pi/2}_0 \frac{du}{\sqrt{1-(k\sin{u})^2}}$ Hi this problem is posed in Sean M. Stewart's How to Integrate It book pg.143
$$K(k) = \int^{\pi/2}_0 \frac{du}{\sqrt{1-(k\sin{u})^2}}$$ where $ 0 \leq k < 1$
Based on the substitution:
$$ \tan{u} = \frac{\sin{2\theta}}{k+k\cos{2\theta}} =\frac{\tan{\theta}}{k}  $$
Show that:
$$K(k) = \frac{1}{1+k}K\left(\frac{2\sqrt{k}}{1+k}\right)$$
$K(k) $ is some function defined in term of definite-integral called complete elliptic integral which is not easily computable, so attacking $K(k)$ gave no fruitful result.
Well then proceeding with substitution ( It is easy to lose track as it  involved a lot of trigonometric manipulations )
I reduced the integral into this form :
$$K(k) = k\int^{\pi/2}_0 \frac{\sec^2{\theta}d\theta}{\sqrt{k^2 + \tan^2{\theta}}\sqrt{k^2 + \tan^2{\theta} - k^2\tan^2{\theta}}}$$
Using substitution : $\tan{\theta} = p$
$$K(k) = k\int^{\infty}_0 \frac{dp}{\sqrt{k^2 +p^2}\sqrt{k^2 +p^2 - (kp)^2}}$$
To my naive eyes this looked manageable but WolframAlpha says otherwise.
Any hint or ideas on how to attack this problem?
I thought  the trig manipulations to find a more suitable form but in the I end up transform $\sin {u}$ term into $\tan{u}$ to use the given substitution
EDIT:  It has been suggested in commens that there is typo in the substituion(given in book) , it should be :
$$ \tan{u} = \frac{\sin{2\theta}}{k+\cos{2\theta}} $$
 A: Here is my solution based on Paramanand Singh's hint:

First convert integral from [0,π/2] to [0,π] and then the interval
[0,π] of u maps to [0,π/2] of θ

Using the definite integral property :
$\int^{2a}_0 f(x) dx = 2\int^a_0 f(x)dx$  if $f(2a-x) = f(x)$
We change the limits to : Upper Limit $ = \pi$ and lower limit $= 0$ which will allow us to use the substitution given in the book [ $$ ]
$$K(k) = \int^{\pi/2}_0 \frac{du}{\sqrt{1-(k\sin{u})^2}} = \frac{1}{2}\int^{\pi}_0 \frac{du}{\sqrt{1-(k\sin{u})^2}} $$
As the substitution is in the form of $\tan u $ we will express the integrand in terms of $\tan u$
We arrive at :
$$\frac{1}{2}\int^{\pi}_0 \frac{\sec{u}du}{\sqrt{1 + \tan^2{u}-(k\tan{u})^2}} $$
Substituting : $\tan{u} = \frac{\sin{2\theta}}{k+\cos{2\theta}}$ [ $$ ]
$$\frac{1}{2}\int^{\pi}_0 \frac{(k+ \cos{2\theta})}{k\cos{2\theta} +1}\sec{u}du $$
Now,
$$\sec^2{u}du = \frac{2(k\cos{2\theta}+1)d\theta}{(k + cos{2\theta})} $$
Leading to a cleaner integral:
$$\int^{\pi/2}_0 \frac{d\theta}{(k+\cos{2\theta})\sec{u}}$$
As
$\sec u = \sqrt{1+ \tan^2{u}} = \frac{\sqrt{k^2 + 1 + 2k\cos{2\theta}}}{(k + \cos{2\theta})} = \frac{\sqrt{(k+1)^2 - 4k\sin^2{\theta}}}{(k + \cos{2\theta})} $
Integrand reduces to desired form:
$$ \int^{\pi/2}_0 \frac{d\theta}{\sqrt{(k+1)^2-(2\sqrt{k} \sin{\theta})^2}} $$
I think it is trivial to take from here to the desired form :)
[ $$ ] If you are coming here from the book, this problem passage had lot of minor typos, rely on this post as a reference.
For.eg

For this substitution it can be shown that the limits of integration
change in the following manner. When u = $0$, $\theta$ = $0$, and when u =
$\pi/2$, $\theta= \pi/2$

This is incorrect
A: I think that you are on the right track. But you have to be aware that the completed elliptic integral of this type can be defined by any of three integrals:
$$
K(k)=\int_0^{\pi/2}\frac{1}{\sqrt{1-k^2\sin^2\theta}}\ d\theta\\=\int_0^1\frac{1}{\sqrt{(1-t^2)(1-k^2t^2)}}\ dt\\
=\int_0^\infty \frac{1}{\sqrt{(1+t^2)[(1+(1-k^2)t^2)}]}\ dt
$$
This is from K. Oldham, J. Myland, & J. Spanier, An Atlas of Functions, Springer . Chapter 61 covers the Complete Elliptic Integrals. Can you take it from here?
A: Hints=    make clever substitute
$$u=x+arctan(\frac{(1-k)tanx}{(1+k)})$$
$$then..u\rightarrow\pi;x\rightarrow\frac{\pi}{2}$$
$$u\rightarrow0;x\rightarrow0$$
Any others can you send s.m.Stewart's book pdf link
