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

Feb 5, 2017

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

#### Explanation:

We can rewrite the integral as two fractions and then integrate teh em separately.

int((x-2)/(x^2+1))dx=color(red)(intx/(x^2+1)dx)-color(blue)(int2/(x^2+1)dx

First integral

$\textcolor{red}{\int \frac{x}{{x}^{2} - 2} \mathrm{dx}}$

using $\int \frac{f ' \left(x\right)}{f} \left(x\right) \mathrm{dx} = \ln | f \left(x\right) |$

$\frac{d}{\mathrm{dx}} \left({x}^{2} + 1\right) = 2 x$

$\therefore \textcolor{red}{\int \frac{x}{{x}^{2} - 2} \mathrm{dx} = \frac{1}{2} \ln | {x}^{2} + 1 |}$

since ${x}^{2} + 1 > 0 \forall \in \mathbb{R} \text{ we can omit the modulus sign}$

second integral

color(blue)(int2/(x^2+1)dx

we integrate by substitution

$x = \tan u \implies \mathrm{dx} = {\sec}^{2} u \mathrm{du}$

color(blue)(int2/(x^2+1)dx=2int1/(tan^2u+1)sec^2udu

=color(blue)(2(int1/cancel(sec^2u)cancel(sec^2u)du)=2intdu

$\textcolor{b l u e}{= 2 u = 2 {\tan}^{- 1} x}$

putting the two results together we have:

int((x-2)/(x^2+1))dx=color(red)(intx/(x^2+1)dx)-color(blue)(int2/(x^2+1)dx

$= \textcolor{red}{\frac{1}{2} \ln \left({x}^{2} + 1\right)} - \textcolor{b l u e}{2 {\tan}^{- 1} x} + C$