Write the numerator as:
3x^2-2x+5 = 3(x^2+1) -2x +23x2−2x+5=3(x2+1)−2x+2
so that:
int (3x^2-2x+5)/(x^2+1)^2 dx = 3int dx/(1+x^2) - int (2xdx)/(x^2+1)^2 +2 int dx/(x^2+1)^2∫3x2−2x+5(x2+1)2dx=3∫dx1+x2−∫2xdx(x2+1)2+2∫dx(x2+1)2
Now solve the integral separately:
int dx/(1+x^2) = arctanx + C_1∫dx1+x2=arctanx+C1
int (2xdx)/(x^2+1)^2 = int (d(x^2+1))/(x^2+1)^2 = -1/(x^2+1)+C_2∫2xdx(x2+1)2=∫d(x2+1)(x2+1)2=−1x2+1+C2
The third integral can be resolved by substituting:
x=tantx=tant
dx = dt/cos^2tdx=dtcos2t
int dx/(x^2+1)^2 = int dt/(cos^2t(1+tan^2t)^2)∫dx(x2+1)2=∫dtcos2t(1+tan2t)2
use now the identity:
1+tan^2t = 1/cos^2t1+tan2t=1cos2t
int dx/(x^2+1)^2 = int dt/(cos^2t/cos^4t) = int cos^2tdt∫dx(x2+1)2=∫dtcos2tcos4t=∫cos2tdt
and as cos^2t = (1+cos2t)/2cos2t=1+cos2t2
int dx/(x^2+1)^2 = 1/2 int dt + 1/2 int cos(2t)dt∫dx(x2+1)2=12∫dt+12∫cos(2t)dt
int dx/(x^2+1)^2 = t/2 + 1/4 int cos(2t)d(2t)∫dx(x2+1)2=t2+14∫cos(2t)d(2t)
int dx/(x^2+1)^2 = t/2 + sin(2t)/4+C_3∫dx(x2+1)2=t2+sin(2t)4+C3
Use now the parametric formula:
sin(2t) = (2tant)/(1+tan^2t)sin(2t)=2tant1+tan2t
to undo the substitution:
int dx/(x^2+1)^2 = arctanx/2 + 1/2x/(1+x^2)+C_3∫dx(x2+1)2=arctanx2+12x1+x2+C3
Putting it together:
int (3x^2-2x+5)/(x^2+1)^2 dx = 3arctanx +1/(x^2+1) + 2(arctanx/2 + 1/2x/(1+x^2))+C∫3x2−2x+5(x2+1)2dx=3arctanx+1x2+1+2(arctanx2+12x1+x2)+C
int (3x^2-2x+5)/(x^2+1)^2 dx = 4arctanx + (x+1)/(x^2+1) +C∫3x2−2x+5(x2+1)2dx=4arctanx+x+1x2+1+C