# How do you integrate  x^2/ [x^2+x+4] using partial fractions?

Nov 9, 2016

$\int \frac{{x}^{2}}{{x}^{2} + x + 4} \text{d} x$

$= x - \frac{1}{2} \ln \left({x}^{2} + x + 4\right) + \frac{7}{\sqrt{15}} {\tan}^{- 1} \left(\frac{2 x + 1}{\sqrt{15}}\right) + c$

where $c$ is the constant of integration.

#### Explanation:

First, write out the partial fractions

$\frac{{x}^{2}}{{x}^{2} + x + 4} = \frac{{x}^{2} + \left(x + 4\right) - \left(x + 4\right)}{{x}^{2} + x + 4}$

$= 1 - \frac{x + 4}{{x}^{2} + x + 4}$

Fractions of the form $\frac{f ' \left(x\right)}{f} \left(x\right)$ integrate to become $\ln \left(f \left(x\right)\right)$. Therefore, suppose $f \left(x\right) = {x}^{2} + x + 4$, then

$f ' \left(x\right) = 2 x + 1$

Rewriting the partial fraction,

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

$= 1 - \frac{1}{2} \frac{2 x + 8}{{x}^{2} + x + 4}$

$= 1 - \frac{1}{2} \frac{2 x + 1}{{x}^{2} + x + 4} + \frac{7}{2} \frac{1}{{x}^{2} + x + 4}$

The last bit requires completing the square, as fractions of the form $\frac{1}{{\left(x - b\right)}^{2} + {a}^{2}}$ integrate to form $\frac{1}{a} {\tan}^{- 1} \left(\frac{x - b}{a}\right)$.

${x}^{2} + x + 4 = {\left(x + \frac{1}{2}\right)}^{2} + \frac{15}{4}$

Rewriting the partial fraction,

$\frac{{x}^{2}}{{x}^{2} + x + 4} = 1 - \frac{1}{2} \frac{2 x + 1}{{x}^{2} + x + 4} + \frac{14}{{\left(2 x + 1\right)}^{2} + 15}$

Now, performing the integration

$\int \frac{{x}^{2}}{{x}^{2} + x + 4} \text{d"x = int "d"x - 1/2 int frac{2x+1}{x^2+x+4} "d} x$

$+ \frac{7}{2} \int \frac{1}{{\left(x + \frac{1}{2}\right)}^{2} + \frac{15}{4}} \text{d} x$

$= x - \frac{1}{2} \ln \left({x}^{2} + x + 4\right) + \frac{7}{\sqrt{15}} {\tan}^{- 1} \left(\frac{2 x + 1}{\sqrt{15}}\right) + c$

where $c$ is the constant of integration.