Use the substitution x = 3tantheta. Then dx = 3sec^2theta d theta.
=>int (3tantheta)^2/sqrt((3tantheta)^2 + 9) * 3sec^2theta d theta
=>int (9tan^2theta)/sqrt(9tan^2theta +9) * 3sec^2theta d theta
=>int (9tan^2theta)/sqrt(9sec^2theta) * 3sec^2theta d theta
=>int (9tan^2theta)/(3sectheta) * 3sec^2theta d theta
=>int 9tan^2thetasectheta d theta
=>9int tantheta(tanthetasectheta)d theta
Use integration by parts for this one. Let u = tantheta and dv = tanthetasectheta d theta. Then du = sec^2thetad theta and v = sectheta.
=>9tanthetasectheta - 9intsec^3theta
This is a (relatively) known integral. The proof can be found here
=>9tanthetasectheta - 9/2secthetatantheta - 9/2ln|sectheta + tantheta| + C
=>9/2tanthetasectheta - 9/2ln|sectheta + tantheta| + C
We know from our initial substitution that tantheta = x/3. This means that the hypotenuse of the right triangle would be sqrt(x^2 + 9), and that sectheta = sqrt(x^2 + 9)/3.
=>9/2(x/3)sqrt(x^2 + 9)/3 - 9/2ln|sqrt(x^2 + 9)/3 + x/3| + C
=>(xsqrt(x^2 + 9))/2 - 9/2ln|(x + sqrt(x^2 +9))/3| + C
Hopefully this helps!