How to find derivative of ln(g(x))