# How do you find the indefinite integral of int (x^4+x-4)/(x^2+2)?

Feb 19, 2017

The answer is $= {x}^{3} / 3 - 2 x + \frac{1}{2} \ln \left({x}^{2} + 2\right) + C$

#### Explanation:

Let's perform a long division

$\textcolor{w h i t e}{a a a a}$${x}^{4}$$\textcolor{w h i t e}{a a a a a a}$$x - 4$$\textcolor{w h i t e}{a a a a}$$|$${x}^{2} + 2$

$\textcolor{w h i t e}{a a a a}$${x}^{4} + 2 {x}^{2}$$\textcolor{w h i t e}{a a a a}$color(white)(aaaaa)|${x}^{2} - 2$

$\textcolor{w h i t e}{a a a a a}$$0 + 2 {x}^{2} + x$$\textcolor{w h i t e}{a a}$$- 4$

$\textcolor{w h i t e}{a a a a a a a a}$$+ 0 + x$$\textcolor{w h i t e}{a a a a}$$0$

Therefore,

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

So,

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

$= {x}^{3} / 3 - 2 x + \int \frac{x \mathrm{dx}}{{x}^{2} + 2}$

For the last integral,

Let $u = {x}^{2} + 2$, $\implies$, $\mathrm{du} = 2 x \mathrm{dx}$

$\int \frac{x \mathrm{dx}}{{x}^{2} + 2} = \frac{1}{2} \int \frac{\mathrm{du}}{u}$

$= \frac{1}{2} \ln u$

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

Putting it all together

$\int \frac{\left({x}^{4} + x - 4\right) \mathrm{dx}}{{x}^{2} + 2} = {x}^{3} / 3 - 2 x + \frac{1}{2} \ln \left({x}^{2} + 2\right) + C$