Taking the simplest case: $$y=2^x$$
If I want to differentiate this I could do: $$y=2^x$$ $$\ln y=\ln 2^x=x\ln2$$ $$\frac{1}{y}\frac{dy}{dx}=\ln2$$ $$\frac{dy}{dx}=y\ln2=2^x \ln2$$
Or I could convert the $2^x$ to $e$ form first and then differentiate:
$$y=2^x=e^{kx}$$ $$\ln2^x=\ln e^{kx}$$ $$x\ln2=kx$$ $$k=\ln2$$ $$y=2^x=e^{kx}=e^{x\ln2}$$ $$\frac{dy}{dx}=e^{x\ln2}(\ln2)=2^x \ln2$$
Both methods work fine for this example, but for more complex situations, which method tends to be a simpler approach?
Making the problem more general, when you face an expression which is a combination of products, quotients, powers, expoentials, logarithmic differentiation helps a lot.
Just as an example, consider $$y=\frac{P^a(x)}{Q^b(x)}\,e^{R(x)}$$ where $P,Q,R$ are functions of any kind.
Take logarithms making $$\log(y)=a\log(P(x))-b\log(Q(x))+R(x)$$ Differentiate $$\frac 1y\frac{dy}{dx}=a \frac{P'(x)}{P(x)}-b\frac{Q'(x)}{Q(x)}+R'(x)$$ Now, just as you did, write $$\frac{dy}{dx}=y \left(\frac 1y\frac{dy}{dx} \right)$$ ans simplify as much as you can.
When you think about it, this is almost the cheapest way to code the derivative.