You don't need substitution to do this integral. Use the Method of Partial Fractions instead.
Set # (2x+7)/(x^2+5x+6)=A/(x+2)+B/(x+3)# and solve for #A# and #B# (note that #x^2+5x+6=(x+2)(x+3)#).
Multiply both sides of the preceding equation by #(x+2)(x+3)# to get, after cancellation, #2x+7=A(x+3)+B(x+2)#. The quickest way to solve for #A# and #B# is to substitute #x=-3# and #x=-2# into this last equation (even though they make the original equation undefined).
#x=-3\Rightarrow 1=-B\Rightarrow B=-1#
#x=-2\Rightarrow 3=A#
Hence, # (2x+7)/(x^2+5x+6)=3/(x+2)-1/(x+3)#
Now substitute, integrate, and use properties of logarithms:
#int (2x+7)/(x^2+5x+6)\ dx=int (3/(x+2)-1/(x+3))\ dx#
#=3ln|x+2|-ln|x+3|+C=ln|((x+2)^3)/(x+3)|+C#