Suppose that (g(x))^2 + 13x = x^2g(x) + 21, and that g(3) = 6. Find g'(3)

just use implicit differentiation:

g^2 + 13x = x^2 g + 21
2g g' + 13 = 2xg + x^2 g'
Now, knowing x=3 and g=6, solve for g'.