# Math Help - Integrate by completing the square.

1. ## Integrate by completing the square.

2. Hello, roza!

By completing the square, show that:

. . $\displaystyle \int^{\frac{1}{2}}_0 \frac{dx}{x^2-x+1} \;=\;\frac{\pi}{3\sqrt{3}}$

Complete the square: . $(x^2-x+\frac{1}{4}) + 1 - \frac{1}{4}$

. . . . . . $=\;(x-\frac{1}{2})^2 + \frac{3}{4} \;=\; (x - \frac{1}{2})^2 + \left(\frac{\sqrt{3}}{2}\right)^2$

We have: . $\displaystyle \int^{\frac{1}{2}}_0 \frac{dx}{\left(x-\frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2}\right)^2}$

Let: . $x - \frac{1}{2} \:=\:\frac{\sqrt{3}}{2}\tan\theta \quad\Rightarrow\quad dx \:=\:\frac{\sqrt{3}}{2}\sec^2\!\theta\,d\theta$

. . and: . $\left(x-\frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2}\right)^2 \;=\; \frac{3}{4}\sec^2\!\theta$

Substitute: . $\displaystyle \int\dfrac{\frac{\sqrt{3}}{2}\sec^2\!\theta\,d\the ta}{\frac{3}{4}\sec^2\!\theta} \;=\; \frac{2}{\sqrt{3}}\!\int d\theta \;=\;\frac{2}{\sqrt{3}}\,\theta + C$

Back-substitute: . $\tan\theta \:=\:\dfrac{x-\frac{1}{2}}{\frac{\sqrt{3}}{2}} \;=\;\dfrac{2x-1}{\sqrt{3}}$

We have: . $\dfrac{2}{\sqrt{3}}\,\arctan\left(\dfrac{2x-1}{\sqrt{3}}\right)\,\bigg]^{\frac{1}{2}}_0$

. . . . $=\; \dfrac{2}{\sqrt{3}}\,\bigg[\arctan 0 - \arctan\left(\text{-}\dfrac{1}{\sqrt{3}}\right)\bigg]$

. . . . $=\;\dfrac{2}{\sqrt{3}}\,\bigg[0 - \left(\text{-}\dfrac{\pi}{6}\right)\bigg]$

. . . . $=\;\dfrac{\pi}{3\sqrt{3}}$

3. $\int{0}{1\2}\frac{dx}{(x^2 - x + 1)}$

Write $x^2 - x + 1$ as $x^2 - x + 1/4 + 3/4 = (x-\frac{1}{2})^2 + (\frac{\sqrt{3}}{2})^2$

This reduces the given integration to a standard form. Now solve it.