Question:
$$\int\frac{dx}{\sqrt{(x-a)(b-x)}}$$
Doubt:
I took take $x=a\cos^2\theta+b\sin^2\theta$ and solved. The final answer that I got was: $$2\sin^{-1}\sqrt{\left(\frac{x-a}{b-a}\right)}+c$$
It matched the answer at the back of my book :)
I was thinking of another way in which I opened the brackets and got a quadratic equation. I then converted it into perfect square to get this form: $$\int\frac{dx}{\sqrt{a^2-x^2}}=\sin^{-1}\left(\frac{x}{a}\right)+c$$ where $x$ was $x-(\frac{a+b}{2})$ and $a$ was $\frac{(a-b)}{2}$.
With this, I got the final answer which was different from the previous one.
Kindly tell what was wrong with the other method?