how to differentiate logarithmic function