# Evaluating an improper integral with radical in denominator

For $a,b\in\mathbb{R}$ and $a<b$, I'd like to evaluate the following improper integral $$\int_a^b \frac{dt}{\sqrt{(b-t)(t-a)}}$$ Since I'd like to evaluate the integral rather than just make sure it converges, the comparison test isn't particularly useful. I started by expanding the terms under the radical, and then I attempted to complete the square. This left me with the following $$\int_a^b \frac{dt}{\sqrt{\left(t-\frac{a+b}{2}\right)^2 - \left(\frac{a+b}{2}\right)^2+ab}}$$ In order for completing the square to be useful, I'd need to be able to make $ab-\left(\frac{a+b}{2}\right)^2$ into a square. I'll just sweep everything under the rug and say $$ab-\left(\frac{a+b}{2}\right)^2 = c^2$$ for some $c\in\mathbb{R}$. Similarly, I'll let $$u^2=\left(t-\frac{a+b}{2}\right)^2$$ Then my resulting integral has the form $$\int_a^b \frac{dt}{\sqrt{u^2-c^2}}$$ I think at this point, I'm supposed to use a trig substitution to finish evaluating the integral. However, because of the substitutions I made above, I'm not really sure how to go about doing the actual substitution. Is there a better way to go about evaluating this integral, or do I just need to continue grinding it out?

-
You should change the limits of integration w.r.t $u$ in the last integral. – Mhenni Benghorbal Oct 17 '12 at 1:40
Sorry, yes. I know. I just haven't worked anything out yet and I'd like to avoid doing so if there's a neater way. I meant to mention that in the post. – chris Oct 17 '12 at 1:43
Shouldn't you have $(b-t)(t-a)$? What you've got, $(b-t)(a-t)$ is negative. – Michael Hardy Oct 17 '12 at 2:21
@MichaelHardy You're right. Fixed. Thanks. – chris Oct 17 '12 at 2:33

\begin{align} u & = \frac{t-a}{b-a} \\[8pt] dt & = (b-a)du \\[8pt] \sqrt{(b-t)(t-a)} & = (b-a)\sqrt{u(1-u)} \end{align} As $t$ goes from $a$ to $b$, then $u$ goes from $0$ to $1$. So $$\int_a^b\frac{dt}{\sqrt{(b-t)(t-a}} = \int_0^1 \frac{du}{\sqrt{u(1-u)}} = \int_0^1 u^{1/2-1} (1-u)^{1/2-1}\,du = B\left(\frac12,\frac12\right).$$

$$=\frac{\Gamma\left(\frac12\right)\Gamma\left(\frac12\right)}{\Gamma\left(\frac12+\frac12\right)} = \pi.$$

Later addendum: A standard identity says that if $$B(\alpha,\beta)=\int_0^1 x^{\alpha-1}(1-x)^{\beta-1}\,dx$$ and $$\Gamma(\alpha)=\int_0^\infty x^{\alpha-1} e^{-x}\,dx$$ then $$B(\alpha,\beta)=\frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}.$$ A proof is as follows. $$\Gamma(\alpha)\Gamma(\beta) = \int_0^\infty u^{\alpha-1}e^{-u}\,du \int_0^\infty v^{\beta-1}e^{-v}\,dv =\int_0^\infty\int_0^\infty u^{\alpha-1}v^{\beta-1}e^{-(u+v)}\,du\,dv.\tag{1}$$ Now let $$x=\frac{u}{u+v}, \qquad y=u+v,$$ $$dx\,dy=\left|\frac{\partial(x,y)}{\partial(u,v)}\right|\,du\,dv = \frac{du\,dv}{u+v} = \frac{du\,dv}{y}$$ $$u = xy,\qquad v = (1-x)y.$$ So $(1)$ becomes $$\int_0^\infty\int_0^1 (xy)^{\alpha-1} ((1-x)y)^{\beta-1} e^{-y} y\,dx\,dy$$ $$= \int_0^1 x^{\alpha-1}(1-x)^{\beta-1}\,dx\cdot\int_0^\infty y^{\alpha+\beta-1} e^{-y}\,dy = B(\alpha,\beta)\Gamma(\alpha+\beta).$$

-
Very nice. I don't think I would have ever thought to make such an odd substitution. Is there any indication that this is a good way to approach the problem? Also, I've worked the integral that you get after making the substitution directly by completing the square (it was inspiration to try it here). Could you explain a little bit more what you've done? – chris Oct 17 '12 at 2:41
If you integrate over a bounded interval with more-or-less arbitrary endpoints can always be transform via a substitution to an integral from $0$ to $1$, so this doesn't seem particularly odd to me. I'll add something about the last integral.... – Michael Hardy Oct 17 '12 at 2:43
Ah that makes sense. Transform it to an integral from $0$ to $1$ and see if the resulting substitution helps. Thanks. – chris Oct 17 '12 at 2:45
I've added more about the gamma and beta functions, but I have not yet explained why $\Gamma(1/2)=\sqrt{\pi}$. But if no one has posted that question to stackexchange, maybe someone should. – Michael Hardy Oct 17 '12 at 3:09
Thanks for all of the extra information. I think I'll probably be digesting this for a while. – chris Oct 17 '12 at 3:20

Alternative approach:

$$\frac{1}{\sqrt{(a-x)(b-x)}}=\left(\frac{1}{\sqrt{a-x}}+\frac{1}{\sqrt{b-x}}\right)\left(\frac{1}{\sqrt{a-x}+\sqrt{b-x}}\right)=-2\left(\frac{-1}{2\sqrt{a-x}}+\frac{-1}{2\sqrt{b-x}}\right)\left(\frac{1}{\sqrt{a-x}+\sqrt{b-x}}\right)$$

Thus:

$$\int_a^b \frac{1}{\sqrt{(a-x)(b-x)}}\;dx=-2\int_a^b\left(\frac{-1}{2\sqrt{a-x}}+\frac{-1}{2\sqrt{b-x}}\right)\left(\frac{1}{\sqrt{a-x}+\sqrt{b-x}}\right)\;dx$$

$$=-2\ln(\sqrt{a-x}+\sqrt{b-x})|_a^b=\ln\left(\frac{b-a}{a-b}\right)=i\pi$$

Edit: noticed there has been a sign change under the square root in OP. This is equivalent to multiplying the above by $1/i$, so the result is now $\pi$, as Michael Hardy has shown.

-
Sorry about the mistake. I'm still working through the details that you've provided to make sure I understand everything. How do you get $\ln(\frac{b-a}{a-b})=i\pi$? – chris Oct 17 '12 at 2:43
@chris No worries. $\frac{b-a}{a-b}=-1$ and $\ln(-1)=i\pi$ (principal value) – user39572 Oct 17 '12 at 2:45
Oh right. That makes a lot of sense. Did you notice that the radical could be split like that right off or did it take a little bit of playing around to get it in that form? I tried splitting the integral into fractions like that but could never get it to work. – chris Oct 17 '12 at 2:47
@chris It took a bit of playing. I was trying to engineer some sort of $u'/u$ form to get logs and I realised that separating the product into sums would work. – user39572 Oct 17 '12 at 2:50
Great. Thanks for all of your help. It's been a while since I've done a lot of integration like this and I'm having problems getting the intuition back, so it helps to hear how solutions were found. – chris Oct 17 '12 at 2:51