Let θ = cos-1(x/3). Then cosθ = x/3
Draw a right triangle with acute angle θ, side adjacent to θ labelled as x, and hypotenuse labelled as 3 (so cosθ = x/3). Then, by the Pythagorean Theorem, the side opposite θ is √(9-x2).
Therefore, tan(cos-1(x/3)) = tanθ = opposite/adjacent = √(9-x2)/x