How to integrate $\int \frac{2x^2+x}{(x+1)(x^2+1)}dx$? How to integrate $\displaystyle \int \frac{2x^2+x}{(x+1)(x^2+1)}dx$? I Tried using partial fractions but i got lost, thanks.
 A: Partial fractions are the way to go. The fraction is already reduced, and the denominator is fully factored over the reals, so your setup is
$$\frac{2x^2+x}{(x+1)(x^2+1)}=\frac{A}{x+1}+\frac{Bx+C}{x^2+1}=\frac{A(x^2+1)+(Bx+C)(x+1)}{(x+1)(x^2+1)}\;,$$
and you must find $A,B$, and $C$ so that $$2x^2+x=A(x^2+1)+(Bx+C)(x+1)=(A+B)x^2+(B+C)x+(A+C)\;.$$
Equating coefficients of powers of $x$ yields the system
$$\left\{\begin{align*}
&A+B=2\\
&B+C=1\\
&A+C=0\;,
\end{align*}\right.$$
which is easily solved: $A=\frac12,B=\frac32$, and $C=-\frac12$. Thus,
$$\frac{2x^2+x}{(x+1)(x^2+1)}=\frac1{2(x+1)}+\frac{3x-1}{2(x^2+1)}\;,$$ and
$$\int\frac{2x^2+x}{(x+1)(x^2+1)}dx=\frac12\int\frac1{x+1}dx+\frac12\int\frac{3x-1}{x^2+1}dx\;.$$
You shouldn’t have any trouble with $\int\frac1{x+1}dx$. The other term is most easily handled by splitting it:
$$\int\frac{3x-1}{x^2+1}dx=3\int\frac{x}{x^2+1}dx-\int\frac1{x^2+1}dx\;,$$
where the first integral succumbs to a $u$-substitution, and the second is one that you should know (or at least be able to work by a trig substitution).
A: The key is to write $(2x^2 + x)$ as $A(x^2+1) + (Bx+C)(x+1)$
$$(2x^2 + x) = A(x^2+1) + (Bx+C)(x+1) = (A+B)x^2 + (B+C)x + (A+C)$$
This gives us $A+B = 2$, $B+C = 1$ and $A+C = 0$ i.e. $A+B = 2$ and $B-A = 1$.
$$A = \dfrac12, B = \dfrac32, C = -\dfrac12$$
Hence, $$\dfrac{2x^2+x}{(x+1)(x^2+1)} = \dfrac1{2(x+1)} + \dfrac{3x-1}{2(x^2+1)} = \dfrac1{2(x+1)} + \dfrac34 \dfrac{2x}{x^2+1} - \dfrac12 \dfrac1{x^2+1}$$
Now you should be able to integrate it.
A: From $\frac{2x^2+ x}{(x+ 1)(x^2+ 1)}= \frac{A}{x+ 1}+ \frac{Bx+ C}{x^2+ 1}$ you can add the fractions on the right, then compare coefficients of "like terms".  But we can also use the fact that this is to be true for all x.  Setting x to any three values gives three equations to solve for A, B, and C.
First multiplying both sides by $x+1$ and $x^2+ 1$ simplifies to $2x^2+ x= A(x^2+ 1)+ (Bx+ C)(x+ 1).
Setting x= -1 immediately gives $2(1)+ (-1)= 1= A(2)$ so $A= \frac{1}{2}$.
Setting x= 0 gives $0= A+ C= \frac{1}{2}+ C$ so $C= -\frac{1}{2}$.
Setting x= 1 gives $2+ 1= 3= 2A+ 2(B+ C)= 1+ 2B- 1$ so $B= \frac{3}{2}$.
