Home » Blog » Evaluate the integral of ((x-a)(b-x))1/2

Evaluate the integral of ((x-a)(b-x))1/2

Evaluate the following integral for b \neq a.

    \[ \int \sqrt{(x-a)(b-x)} \, dx. \]


(Note: This is a pretty involved problem the way I’ve done it. Maybe there’s a better way? Let me know if you have one. Also, there is an error in the answer in the book on this problem and the next one. The answers given in the book are swapped, so the answer listed for this problem #46 is actually the answer for #47 and vice-versa.)

There are some integrals we’ll want to use to carry out the evaluation of the above integral. First, from previous exercises here and here (Section 5.10, Exercises #7 and #10(b)) we know

    \begin{align*}  \int \sin^2 x \, dx &= \frac{1}{2} x - \frac{1}{4} \sin (2x) \\  \int \sin^4 x \, dx &= \frac{3}{8} x - \frac{1}{4} \sin (2x) + \frac{1}{32} \sin (4x). \end{align*}

Therefore, (we’ll want this later), we have

    \begin{align*}  \int (\sin^2 x - \sin^4 x ) \, dx &= \left( \frac{1}{2} x - \frac{1}{4} \sin (2x) \right) - \left( \frac{3}{8} x - \frac{1}{4} \sin (2x) + \frac{1}{32} \sin (4x) \right) \\  &= \frac{1}{8} x - \frac{\sin (4x)}{32} + C\\  &= \frac{1}{8} x - \frac{\sin (2x) \cos (2x)}{16} + C\\  &= \frac{1}{8} x - \frac{\sin x \cos x \cos (2x)}{8} + C\\  &= \frac{1}{8} \left( x - \sin x \cos x (1 - 2 \sin^2 x) \right) + C\\  &= \frac{1}{8} \left( x - \sin x \cos x + 2 \sin^3 x \cos x \right) + C. \end{align*}

The other integral that we are going to want to have available is

    \[ \int x^2 \sqrt{1-x^2} \, dx. \]

To evaluate this we’ll use the trig integrals above. First, make the substitution

    \[ \sin t =  x \qquad \implies \qquad \cos t \, dt =  dx \]

and also gives us

    \[ t = \arcsin x \qquad \text{and} \qquad dt = \frac{dx}{\cos t}. \]

Therefore we have

    \begin{align*}  \int x^2 \sqrt{1-x^2} \, dx &= \int \sin^2 t \sqrt{1 - \sin^2 t} \cos t \, dt \\  &= \int \sin^2 t \sqrt{\cos^2 t} \cos t \, dt \\  &= \int \sin^2 t \cos^2 t \, dt \\  &= \int \sin^2 t (1 - \sin^2 t) \, dt \\  &= \int (\sin^2 t - \sin^4 t) \, dt \\  &= \frac{1}{8}\left( t - \sin t \cos t + 2 \sin^3 t \cos t \right) + C. \end{align*}

Then, substituting back in for x (and noting that \sin (\arcsin x) = x and \cos (\arcsin x) = \sqrt{1-x^2}) we have

    \begin{align*}  \int x^2 \sqrt{1-x^2} \, dx &= \frac{1}{8} \left( t - \sin t \cos t + 2 \sin^3 t \cos t \right) + C\\  &= \frac{1}{8} \left( \arcsin x - x \sqrt{1-x^2} + 2 x^3 \sqrt{1-x^2} \right) + C \\  &= \frac{1}{8} \arcsin x - \frac{1}{8} x \sqrt{1-x^2} (1 - 2x^2) + C. \end{align*}

So, now that we have those, we can turn our attention to the integral in the question. For this integral we want to make the substitution

    \[ t = \frac{x-a}{b-a} \quad \implies \quad dt = \frac{dx}{b-a}. \]

which implies

    \[ x = t(b-a) + a \quad \text{and} \quad dx = (b-a) \, dt. \]

Therefore we have

    \begin{align*}  \int \sqrt{(x-a)(b-x)} \, dx &= \int \sqrt{(t(b-a)+a - a)(b - t(b-a) - a)} \, (b-a)dt \\  &= (b-a) \int \sqrt{t(b-a)(b-a)(1-t)} \, dt \\  &= (b-a) |b-a| \int \sqrt{t} \sqrt{1-t} \, dt. \end{align*}

Now, we want to make the substitution

    \[ u = \sqrt{t} \quad \implies \quad du = \frac{1}{2\sqrt{t}} \, dt, \]

and implies

    \[ t = u^2 \quad \text{and} \quad dt = 2u \, du. \]

Therefore,

    \begin{align*}  \int \sqrt{(x-a)(b-x)} \, dx &= (b-a)|b-a| \int \sqrt{t} \sqrt{1-t} \, dt \\   &= (b-a)|b-a| \int u \sqrt{1-u^2} 2u \, du \\  &= 2 (b-a)|b-a| \int u^2 \sqrt{1-u^2} \, du. \end{align*}

Now, we can use the work we did above in the evaluation of this integral,

    \begin{align*}  \int \sqrt{(x-a)(b-x)} \, dx &= 2 (b-a)|b-a| \int u^2 \sqrt{1-u^2} \, du \\  &= 2(b-a)|b-a| \left( \frac{1}{8} \arcsin u - \frac{1}{8} u \sqrt{1-u^2} (1-2u^2) \right) + C \\  &= \frac{1}{4}|b-a|(b-a) \left(\arcsin u + u \sqrt{1-u^2} (2u^2 - 1)\right) + C. \end{align*}

Finally, we have to unwind our substitutions to get back to a function of x. We have

    \[ u = \sqrt{t} = \sqrt{ \frac{x-a}{b-a}}. \]

Therefore,

    \begin{align*}  \int \sqrt{(x-a)(b-x)} \, dx &= \frac{1}{4}|b-a|(b-a) \left(\arcsin u + \frac{1}{4} u \sqrt{1-u^2} (2u^2 - 1)\right) + C\\[10pt]  &= \frac{1}{4} |b-a|(b-a) \arcsin \left( \sqrt{\frac{x-a}{b-a}} \right) + \\  &\qquad \frac{1}{4} |b-a|(b-a) \left( \sqrt{\frac{x-a}{b-a}} \right) \left(\sqrt{ 1 - \frac{x-a}{b-a} } \right) \left( 2 \frac{x-a}{b-a} - 1 \right) + C \\[10pt]  &= \frac{1}{4} |b-a|(b-a) \arcsin \left( \sqrt{\frac{x-a}{b-a}} \right) + \\  &\qquad \frac{1}{4} |b-a|(b-a) \sqrt{ \frac{(x-a)(b-a) - (x-a)^2}{(b-a)^2} } \cdot \frac{2x-2a-(b-a)}{b-a}+ C \\[10pt]  &= \frac{1}{4}|b-a|(b-a) \arcsin \sqrt{ \frac{x-a}{b-a}} \\  & \qquad  + \frac{1}{4} \sqrt{x-a} \sqrt{b-a - (x-a)} \cdot (2x - b - a) + C \\[10pt]  &= \frac{1}{4}|b-a|(b-a) \arcsin \sqrt{\frac{x-a}{b-a}} + \frac{1}{4} \sqrt{(x-a)(b-x)} (2x - (a+b))  + C. \end{align*}

This completes our evaluation of the integral.

5 comments

  1. Anonymous says:

    doing a little bit of algebra sqrt((x-a)(b-x))=|a-b|sqrt(1-((2x-a-b)/(a-b))^2)/2
    then by substitution u=(2x-a-b)/(a-b) you integrate (|a-b|/2)integral(sqrt(1-u^2))

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):