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.

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

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.