<s>[INST] Definite integration with variable substitution gives wrong result I have the following definite integral:
$$\int^{5}_{-5}{\sqrt{25-x^2} dx}$$
I do a variable substitution:
$$y = 25 - x^2$$
$$x = \sqrt{25 - y}$$
$$dy = -2x~dx$$
$$dx = \frac{dy}{-2x} = -\frac{1}{2\sqrt{25-y}}$$
I get the new integral:
$$-\frac{1}{2}\int^{0}_{0}{\sqrt{\frac{y}{25-y}} dy}$$
From Integral table I get that this integral (24) may be solved as:
$$-\frac{1}{2}(-\sqrt{y(25-y)}-25\tan^{-1}\frac{\sqrt{y(25-y)}}{y-25})\biggr\rvert^0_{0}$$
Going back to $x$ I get:
$$-\frac{1}{2}(-\sqrt{(25-x^2)x^2}-25\tan^{-1}\frac{\sqrt{(25-x^2)x^2}}{-x^2})\biggr\rvert^5_{-5}$$
Then:
$$\frac{1}{2}x\sqrt{25-x^2}+\frac{25}{2}\tan^{-1}\frac{-\sqrt{25-x^2}}{x}\biggr\rvert^5_{-5}$$
But I get $0$ as result, while the right answer is $\frac{25\pi}{2}$.
Where is the mistake?
 [/INST] $\sqrt{25-x^2}$ is an even function.
So $$\boxed{\int_{-5}^5 \sqrt{25-x^2} dx=2\cdot \int_{0}^5 \sqrt{25-x^2} dx}$$
Now proceed the way you have, by substitution with $y$ and so on. You will get the desired result.
</s>