<s>[INST] How to evaluate the following integral$\int_a^{pa}\frac{ax}{\sqrt{(a-x)(x-pa)}}dx$? Can anyone help me to evaluate the definite integral $\int_a^{pa}\frac{ax}{\sqrt{(a-x)(x-pa)}}dx$?I encountered this integral while doing a problem of particle dynamics in Ganguly Saha(Applied Mathematics).Can this integral be evaluated without the substitution of $x=asin^2\theta+pacos^2\theta$.Please anyone suggest some other method i.e. some direct method to calculate this integral.
 [/INST] Introducing integral by parts,
\begin{equation}
\begin{aligned}
I&=a \int^{pa}_a\frac{x}{\sqrt{(a-x)(p a-x)}}dx \\
&=\frac{a}{2}
\left\{
a(1+p)\int^{pa}_a\frac{1}{\sqrt{(a-x)(p a-x)}}dx
-\int^{pa}_a\frac{d[(a-x)(p a-x)]}{\sqrt{(a-x)(p a-x)}}
\right\} \\
&=\frac{a}{2}
\left\{
a(1+p)\int^{pa}_a\frac{1}{\sqrt{(a-x)(p a-x)}}dx
-2\left[\sqrt{(a-x)(p a-x)}\right]^{pa}_a
\right\} \\
&=\frac{a^2(1+p)}{2}\int^{pa}_a\frac{1}{\sqrt{(a-x)(p a-x)}}dx
\end{aligned}
\end{equation}
Transforming the variable $x$ to $t$ using the relation,
\begin{equation}
\begin{aligned}
t=\sqrt{\frac{pa-x}{x-a}}
\end{aligned}
\end{equation}
which gives,
\begin{equation}
\begin{aligned}
x=a\frac{p+t^2}{1+t^2}
\end{aligned}
\end{equation}
the integral $I$ is expressed as,
\begin{equation}
\begin{aligned}
I&=\frac{a^2(1+p)}{2}\int^{pa}_a\frac{1}{\sqrt{(a-x)(p a-x)}}dx \\
&=\frac{a^2(1+p)}{2}\int^{0}_{\infty}\frac{1}{t}\sqrt{\frac{(1+t^2)^2}{a^2(1-p)^2}}\frac{2a(1-p)t}{(1+t^2)^2}dt
\end{aligned}
\end{equation}
In the cases of (1)$a\geq 0, p\leq 1$ and (2)$a\leq 0, p\geq 1$, the integral can be expressed as
\begin{equation}
\begin{aligned}
I&=-a^2(1+p)\int^{\infty}_{0}\frac{dt}{1+t^2}=-\frac{a^2(1+p)\pi}{2}
\end{aligned}
\end{equation}
In the cases of (3)$a\leq 0, p\leq 1$ and (4)$a\geq 0, p\geq 1$, the integral can be expressed as
\begin{equation}
\begin{aligned}
I&=a^2(1+p)\int^{\infty}_{0}\frac{dt}{1+t^2}=\frac{a^2(1+p)\pi}{2}
\end{aligned}
\end{equation}
</s>