# Different solutions for same integral when using different variables

Consider the following integral:

$$I := \int_1^2 \frac{1}{\sqrt{(2-x) (x-1)}} \, dx.$$

The solution of this integral is $I = \pi$.

I typed this integral into Mathematica in a more general form:

Integrate[1/Sqrt[(a - x)*(x - b)], {x, b, a}]


But the output of this is $0$.

Using different variables:

Integrate[1/Sqrt[(x1 - x)*(x - x2)], {x, x2, x1}]


gives the right solution $\pi$.

I don't see the difference between my two inputs. I also used ClearAll[a, b, x1, x2] before evaluating.

• I am using Wolfram Mathematica 10.2 Dec 19 '17 at 12:32
• in ver 11.2 (macOS 10.13.2) ConditionalExpression[\[Pi], a >= b] assuming $a,b\in \mathcal{R}$ Dec 19 '17 at 13:09