Solution:
Write the numerator in terms of the derivative of x2−1, which is 2x:
x+2=21(2x)+2
Therefore,
∫x2−1x+2dx=21∫x2−12xdx+2∫x2−1dx=I1+I2
In I1, put x2−1=t, so that 2xdx=dt.
I1=21∫tdt=21⋅2t=x2−1+C1
For I2, use the standard integral ∫x2−a2dx=logx+x2−a2+C with a=1:
I2=2logx+x2−1+C2
Adding I1 and I2,
∫x2−1x+2dx=x2−1+2logx+x2−1+C