<s>[INST] finding an indefinite integral of a fraction (a) Show that $\frac{4-3x}{(x+2)(x^2+1)}$ can be written in the form ${\frac{A}{x+2} + \frac{1-Bx}{x^2+1}}$ and find the constants $A$ and $B$. 
(b) Hence find $\displaystyle\int\frac{4-3x}{(x+2)(x^2+1)}dx$
For (a) I found that $B=2$ and $A=2$
And I am not quite sure how to integrate. I tried to split them into two $\displaystyle\int\frac{2}{x+2
}dx$ and $\displaystyle\int\frac{1-2x}{x^2+1}dx$ but I don't know how to do after. 
 [/INST] Well,
$$\int\frac{2}{x+2} dx= 2\log(x+2)$$
So you have that part.
But for:
$$\int\frac{1-2x}{x^2 + 1} dx$$
You must further decompose this fraction into partial fractions:
$$\frac{1 - 2x}{x^2 + 1} = \frac{1}{x^2 + 1} - \frac{2x}{x^2 + 1}$$
So this integral becomes:$$\int\frac{1 - 2x}{x^2 + 1} dx= \int\frac{1}{x^2 + 1}dx - \int\frac{2x}{x^2 + 1}dx$$
$$= \tan^{-1}x - \log(x^2 + 1)$$
And overall:
$$\int\frac{4-3x}{(x+2)(x^2 + 1)}= 2\log(x+2) + \tan^{-1}x - \log(x^2 + 1) + c$$
Note that the constant is ommited till the end, just to simplify the answer.
</s>