to (A): The 3 in the numerator of the quotient has nothing to do with the variable x. It is a constant factor which can be taken in front of the integral.
(B) The 2 in the numerator is the derivate of the denominator and is used to do the integration by substitution.
Use the search function of the forum and look for examples of integration by substitution. For instance Krizalid has posted a lot of examples.