# Integration problemo

#### Sherlock

##### Member
Consider $\displaystyle I = \displaystyle \int_{3}^{4}\frac{1}{\sqrt{(3-x)(x-4)}}\;{dx}.$ It can be shown that this is $\pi$.

Let $t = 3-x$ for the integral and you get $\displaystyle I = -\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}.$

However, the latter integral is equal to $-\pi$. Where is the negative from?

Last edited:

#### Sudharaka

##### Well-known member
MHB Math Helper
Re: Something really weird

Consider $\displaystyle I = \int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}.$ It can be shown that this is $\pi$.

Let $t = 3-x$ for the integral and you get $\displaystyle I = -\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}.$

However, the latter integral is equal to $-\pi$. Where is the negative from?
Hi Sherlock,

Both integrals should be equal to $$-\pi$$. Can you write down your solution for the first integral, maybe you are missing a minus sign somewhere.

>>Integral 1<<

>>Integral 2<<

Kind Regards,
Sudharaka.

#### Sherlock

##### Member
Re: Something really weird

Hi Sherlock,

Both integrals should be equal to $$-\pi$$. Can you write down your solution for the first integral, maybe you are missing a minus sign somewhere.

>>Integral 1<<

>>Integral 2<<

Kind Regards,
Sudharaka.
Hello, Sudharaka. I did plug that in Wolfram but it gave me this!

#### Sudharaka

##### Well-known member
MHB Math Helper
Re: Something really weird

Hello, Sudharaka. I did plug that in Wolfram but it gave me this!
I don't understand what is happening with wolfram, but you can solve this integral using the Beta function.

$I = \int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}$

Substitute, $$t=x-3$$ and we get,

\begin{eqnarray}

I &=& \int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}\\

&=&-\int_{0}^{1}t^{-\frac{1}{2}}(1-t)^{-\frac{1}{2}}\,dt\\

&=&-\beta\left(\frac{1}{2},\frac{1}{2}\right)\\

\end{eqnarray}

Since, $$\beta(x,y)=\dfrac{\Gamma(x)\,\Gamma(y)}{\Gamma(x+y)}\!$$ we have,

$I=-\frac{\Gamma\left(\frac{1}{2}\right)\,\Gamma\left(\frac{1}{2}\right)}{\Gamma(1)}=-\pi$

#### Sherlock

##### Member
Re: Something really weird

That's how I did it as well. But I still don't understand the negative anomaly.

Apparently $\displaystyle I = \int_{3}^{4}\bigg[(3-x)(x-4)\bigg]^{-\frac{1}{2}}\;{dx} = -\int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}?$

#### Sudharaka

##### Well-known member
MHB Math Helper
Re: Something really weird

Consider $\displaystyle I = \int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}.$ It can be shown that this is $\pi$.
No. Refer my previous post and you'll and see that it's equal to $$-\pi$$.

That's how I did it as well. But I still don't understand the negative anomaly.

Apparently $\displaystyle I = \int_{3}^{4}\bigg[(3-x)(x-4)\bigg]^{-\frac{1}{2}}\;{dx} = -\int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}?$
Can you please show how you calculated the second integral?

#### Sherlock

##### Member
Re: Something really weird

No. Refer my previous post and you'll and see that it's equal to $$-\pi$$.

Can you please show how you calculated the second integral?
Sorry, the first post should have read:

Consider $\displaystyle \int_{3}^{4}\bigg[(3-x)(x-4)\bigg]^{-\frac{1}{2}}\;{dx}.$ It can be shown that this is $\pi$.

Let $t = 3-x$ for the integral and you get $\displaystyle I = -\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}.$

However, the latter integral is equal to $-\pi$. Where is the negative from?
Wolfram agrees that the first integral is $\pi$ (see my link above).

But as you have seen the second integral is $-\pi$. Why is this?

#### Sudharaka

##### Well-known member
MHB Math Helper
Re: Something really weird

Sorry, the first post should have read:

Wolfram agrees that the first integral is $\pi$ (see my link above).

But as you have seen the second integral is $-\pi$. Why is this?
I don't know why wolfram gives different answers when the problem is stated in different ways. Maybe some other member will be able to enlighten you as to why wolfram behaves that way. However we have obtained that,

$\int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}=-\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}\,dt=-\pi$

#### Sherlock

##### Member
Re: Something really weird

I don't know why wolfram gives different answers when the problem is stated in different ways. Maybe some other member will be able to enlighten you as to why wolfram behaves that way. However we have obtained that,

$\int_{3}^{4}(3-x)^{-\frac{1}{2}}(x-4)^{ - \frac{1}{2}}\;{dx}=-\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}\,dt=-\pi$
You still don't get me. Let me illustrate what I mean by way of a solution:

Let $x = \frac{7}{2}+t$ then we have:

\displaystyle \begin{aligned} I & = \int_{3}^{4}\frac{1}{\sqrt{(3-x)(x-4)}}\;{dx} = \int_{-\frac{1}{2}}^{\frac{1}{2}} \frac{1}{\sqrt{(\frac{1}{2})^2-t^2}}\;{dt} = 2 \int_{0}^{\frac{1}{2}}\frac{1}{\sqrt{(\frac{1}{2})^2-t^2}}\;{dt} \\& = 2\sin^{-1}(2t)\bigg|_{0}^{1/2} = 2\sin^{-1}(1)-2\sin^{-1}(0) = \pi. \end{aligned}

But if we do it the beta function way like you have done, we get $-\pi$.

I hope you understand what I mean now. This is driving me insane!

#### dwsmith

##### Well-known member
Re: Something really weird

Here is the full version of Mathematica's solution.

View attachment 460

#### Sherlock

##### Member
Re: Something really weird

Here is the full version of Mathematica's solution.

View attachment 460
What does it give when you enter $\displaystyle \int_{3}^{4}\frac{1}{\sqrt{(3-x)(x-4)}}\;{dx}$ (both terms under the radical), though? Thanks.

#### dwsmith

##### Well-known member
Re: Something really weird

What does it give when you enter $\displaystyle \int_{3}^{4}\frac{1}{\sqrt{(3-x)(x-4)}}\;{dx}$ (both terms under the radical), though? Thanks.
For that integral it, gave me pi whereas the other two gave the set containing -pi.

#### Opalg

##### MHB Oldtimer
Staff member
Consider $\displaystyle I = \displaystyle \int_{3}^{4}\frac{1}{\sqrt{(3-x)(x-4)}}\;{dx}.$ It can be shown that this is $\pi$.

Let $t = 3-x$ for the integral and you get $\displaystyle I = -\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}.$

However, the latter integral is equal to $-\pi$. Where is the negative from?
The notation $\sqrt x$ (for a positive number $x$) by definition means the positive square root. If you integrate a positive function over a (positively oriented) interval, you can never get a negative answer. So if the answer comes out as $-\pi$, you know that something has gone wrong somewhere.

In this case, something is odd about the integral $-\displaystyle\int_{0}^{-1}t^{-\frac{1}{2}}(-1-t)^{-\frac{1}{2}}\,dt$, because $t$ and $-1-t$ are both negative when $-1<t<0$, and therefore do not have real square roots. But their product is positive, so you can write the integral as $-\displaystyle\int_{0}^{-1}\bigl(t(-1-t)\bigr)^{-\frac{1}{2}}\,dt = \int_{-1}^{0}\bigl(t(-1-t)\bigr)^{-\frac{1}{2}}\,dt$. This should come out as $+\pi$.

#### Sherlock

##### Member
Thanks. Could you explain bit more as to how inverting the limits voids the negative, please? I can't see it.

I know it cancels the immediate one before the integral, but in the end we still end-up with $-\pi$? Thanks!

#### Opalg

##### MHB Oldtimer
Staff member
Thanks. Could you explain bit more as to how inverting the limits voids the negative, please? I can't see it.

I know it cancels the immediate one before the integral, but in the end we still end-up with $-\pi$? Thanks!
As far as I can see, the mistake comes from mishandling the expression $1/\sqrt{(3-x)(x-4)}$. If you write it as $(3-x)^{-1/2}(x-4)^{-1/2}$, then (in the interval $3<x<4$ over which you are integrating) that is the product of two complex numbers. Both $3-x$ and $x-4$ are negative in that interval, so each of them has two purely-imaginary square roots and there is no reliable way to select one of those roots rather than the other.

What you should do, if you want to transform the integral into a beta-function form, is to re-write $1/\sqrt{(3-x)(x-4)}$ as $1/\sqrt{(x-3)(4-x)} = (x-3)^{-1/2}(4-x)^{-1/2}$. That is now the product of two positive numbers and you can make the substitution $t=x-3$ to get the integral in the form $\displaystyle\int_0^1t^{-1/2}(1-t)^{-1/2}\,dt = \beta(1/2,1/2).$

#### Sudharaka

##### Well-known member
MHB Math Helper
I have fallen into >>this trap<< a couple of times yet never learns form the mistake.

@Opalg: Thank you very much for your valuable insight into this problem.