Rewriting the denominator:
int(3x^2+5x-1)/(x^2+2x-1)^2dx=int(3x^2+5x-1)/{(x^2+2x+1)-2}^2dx=int(3x^2+5x-1)/{(x+1)^2-2}^2dx∫3x2+5x−1(x2+2x−1)2dx=∫3x2+5x−1{(x2+2x+1)−2}2dx=∫3x2+5x−1{(x+1)2−2}2dx
Let u=x+1u=x+1, implying that x=u-1x=u−1 and du=dxdu=dx.
=int(3(u-1)^2+5(u-1)-1)/(u^2-2)^2du=int(3u^2-u-3)/(u^2-2)^2du=∫3(u−1)2+5(u−1)−1(u2−2)2du=∫3u2−u−3(u2−2)2du
Now let u=sqrt2secthetau=√2secθ. This implies that u^2-2=2sec^2theta-2=2tan^2thetau2−2=2sec2θ−2=2tan2θ and that du=sqrt2secthetatanthetad thetadu=√2secθtanθdθ.
=int(3(2sec^2theta)-sqrt2sectheta-3)/(2tan^2theta)^2(sqrt2secthetatanthetad theta)=∫3(2sec2θ)−√2secθ−3(2tan2θ)2(√2secθtanθdθ)
=sqrt2/4int(6sec^3theta-sqrt2sec^2theta-3sectheta)/tan^3thetad theta=√24∫6sec3θ−√2sec2θ−3secθtan3θdθ
Multiplying through by cos^3theta/cos^3thetacos3θcos3θ:
=1/(2sqrt2)int(6-sqrt2costheta-3cos^2theta)/sin^3thetad theta=12√2∫6−√2cosθ−3cos2θsin3θdθ
=3/sqrt2intcsc^3thetad theta-1/2intcotthetacsc^2thetad theta-3/(2sqrt2)int(1-sin^2theta)/sin^3thetad theta=3√2∫csc3θdθ−12∫cotθcsc2θdθ−32√2∫1−sin2θsin3θdθ
Note that 3/sqrt2-3/(2sqrt2)=3/(2sqrt2)3√2−32√2=32√2:
=3/(2sqrt2)intcsc^3thetad theta-1/2intcotthetacsc^2thetad theta+3/(2sqrt2)intcscthetad theta=32√2∫csc3θdθ−12∫cotθcsc2θdθ+32√2∫cscθdθ
Find the method for integrating csc^3thetacsc3θ here.
For the second integral, let v=cotthetav=cotθ so dv=-csc^2thetad thetadv=−csc2θdθ.
The integral of cscthetacscθ is well known. For its derivation, see here.
=3/(2sqrt2)(-1/2)(cotthetacsctheta+lnabs(cottheta+csctheta))+1/2intvdv+3/(2sqrt2)lnabs(csctheta-cottheta)=32√2(−12)(cotθcscθ+ln|cotθ+cscθ|)+12∫vdv+32√2ln|cscθ−cotθ|
Note that 1/2intvdv=1/2(v^2/2)=v^2/4=cot^2theta/412∫vdv=12(v22)=v24=cot2θ4.
=-3/(4sqrt2)cotthetacsctheta-3/(4sqrt2)lnabs(cottheta+csctheta)+3/(4sqrt2)lnabs(csctheta-cottheta)+1/4cot^2theta=−34√2cotθcscθ−34√2ln|cotθ+cscθ|+34√2ln|cscθ−cotθ|+14cot2θ
Our substitution was u=sqrt2secthetau=√2secθ, implying that costheta=sqrt2/ucosθ=√2u, which is a right triangle where the side adjacent to thetaθ is sqrt2√2, the hypotenuse is uu, and the side opposite thetaθ is sqrt(u^2-2)√u2−2.
Thus, csctheta=u/sqrt(u^2-2)cscθ=u√u2−2 and cottheta=sqrt2/sqrt(u^2-2)cotθ=√2√u2−2.
Also note that -3/(4sqrt2)lnabs(cottheta+csctheta)+3/(4sqrt2)lnabs(csctheta-cottheta)=3/(4sqrt2)lnabs((csctheta-cottheta)/(cottheta+csctheta))=3/(4sqrt2)lnabs((1-costheta)/(1+costheta))−34√2ln|cotθ+cscθ|+34√2ln|cscθ−cotθ|=34√2ln∣∣∣cscθ−cotθcotθ+cscθ∣∣∣=34√2ln∣∣∣1−cosθ1+cosθ∣∣∣.
=-3/(4sqrt2)(sqrt2u)/(u^2-2)+3/(4sqrt2)lnabs((1-sqrt2/u)/(1+sqrt2/u))+1/4(2/(u^2-2))=−34√2√2uu2−2+34√2ln∣∣
∣∣1−√2u1+√2u∣∣
∣∣+14(2u2−2)
=-3/4(u/(u^2-2))+1/2(1/(u^2-2))+3/(4sqrt2)lnabs((u-sqrt2)/(u+sqrt2))=−34(uu2−2)+12(1u2−2)+34√2ln∣∣∣u−√2u+√2∣∣∣
=(-3u+2)/(4(u^2-2))+3/(4sqrt2)lnabs((u-sqrt2)/(u+sqrt2))=−3u+24(u2−2)+34√2ln∣∣∣u−√2u+√2∣∣∣
With u=x+1u=x+1:
=(-3x-1)/(4(x^2+2x-1))+3/(4sqrt2)lnabs((x-sqrt2+1)/(x+sqrt2+1))+C=−3x−14(x2+2x−1)+34√2ln∣∣∣x−√2+1x+√2+1∣∣∣+C