Evaluate $\int_a^{2a}\sqrt{2ax-x^2}\:dx$ where $a$ is a constant. Evaluate $$\int_a^{2a}\sqrt{2ax-x^2}\:dx$$ where $a$ is a constant.

I used substitution, $x=a(1-\sin k)$. This is my working

But I think I made some mistake since answer isn't correct. Please help.
 A: Assume $a\geq0$. One may write
$$
\begin{align}
\int_a^{2a}\sqrt{2ax-x^2}\:dx&=a^2\int_1^2\sqrt{2u-u^2}\:du \quad (x=au,\,dx=adu)
\\\\&=a^2\int_1^2\sqrt{1-(u-1)^2}\:du
\\\\&=a^2\int_0^{\pi/2}\cos \theta\:\sqrt{1-\sin^2\theta}\:d\theta \quad (u-1=\sin \theta)
\\\\&=a^2\int_0^{\pi/2}\cos^2\!\theta \:d\theta 
\\\\&=a^2\int_0^{\pi/2}\frac{1+\cos(2\theta)}2 \:d\theta 
\\\\&=a^2\left[\frac{\theta+\frac{\sin(2\theta)}2}2 \right]_0^{\pi/2}
\\\\&=\frac{\pi}4a^2.
\end{align}
$$
A: 
Assume $a\ge0$:

$$\int_{a}^{2a}\sqrt{2ax-x^2}\space\text{d}x=\int_{a}^{2a}\sqrt{a^2-\left(x-a\right)^2}\space\text{d}x=$$

Substitute $u=x-a$ and $\text{d}u=\text{d}x$.
This gives a new lower bound $u=a-a=0$ and upper bound $u=2a-a=a$:

$$\int_{0}^{a}\sqrt{a^2-u^2}\space\text{d}u=$$

Substitute $u=a\sin(s)$ and $\text{d}u=a\cos(s)\space\text{d}s$.
Then $\sqrt{a^2-u^2}=\sqrt{a^2-a^2\sin^2(s)}=a\cos(s)$ and $s=\arcsin\left(\frac{u}{a}\right)$.
This gives a new lower bound $s=\arcsin\left(\frac{0}{a}\right)=0$ and upper bound $s=\arcsin\left(\frac{a}{a}\right)=\frac{\pi}{2}$:

$$a^2\int_{0}^{\frac{\pi}{2}}\cos^2(s)\space\text{d}s=$$

Use $\cos^2(y)=\frac{\cos(2y)+1}{2}$:

$$a^2\int_{0}^{\frac{\pi}{2}}\left[\frac{1}{2}+\frac{\cos(2s)}{2}\right]\space\text{d}s=a^2\left[\frac{1}{2}\int_{0}^{\frac{\pi}{2}}1\space\text{d}s+\frac{1}{2}\int_{0}^{\frac{\pi}{2}}\cos(2s)\space\text{d}s\right]=$$
$$a^2\left[\frac{1}{2}\left[s\right]_{0}^{\frac{\pi}{2}}+\frac{1}{2}\int_{0}^{\frac{\pi}{2}}\cos(2s)\space\text{d}s\right]=a^2\left[\frac{\pi}{4}+\frac{1}{2}\int_{0}^{\frac{\pi}{2}}\cos(2s)\space\text{d}s\right]=$$

Substitute $p=2s$ and $\text{d}p=2\space\text{d}s$.
This gives a new lower bound $p=2\cdot0=0$ and upper bound $p=2\cdot\frac{\pi}{2}=\pi$:

$$a^2\left[\frac{\pi}{4}+\int_{0}^{\pi}\cos(p)\space\text{d}p\right]=a^2\left[\frac{\pi}{4}+\left[\sin(p)\right]_{0}^{\pi}\right]=$$
$$a^2\left[\frac{\pi}{4}+\sin(\pi)-\sin(0)\right]=a^2\left[\frac{\pi}{4}+0-0\right]=a^2\left[\frac{\pi}{4}\right]=\frac{a^2\pi}{4}$$
A: Follow the steps
1) complete the square 
2) use the substitution $u=x-a$
3) make another substitution $u=a\tan t$
