# L'hopital's rule in deriving Cobb-Douglas function from CES production function

$$\ln(Y) = \ln(A) + \frac{\ln[\alpha K^\gamma + (1-\alpha) L^\gamma]}{\gamma}$$

can be taken to the limit by applying l'Hôpital's rule:

$$\lim_{\gamma\rightarrow 0} \ln(Y) = \ln(A) + \alpha \ln(K) + (1-\alpha) \ln(L).$$

I am not sure how l'Hopital's rule was used - differentiating by $\gamma$ produces some weird results.

Note that $$\frac{d}{d\gamma}\ln[\alpha K^\gamma + (1-\alpha) L^\gamma] = \frac{\alpha K^{\gamma}\ln (K) -(\alpha -1)L^{\gamma}\ln (L)}{\alpha K^{\gamma}-(\alpha-1)L^{\gamma}}$$ where that fact that $\frac{d}{dx} a^x = a^x \ln(a)$ is used.
Then by L'Hospital, $$\lim_{\gamma\to 0} \ln Y = \ln (A)+ \lim_{\gamma\to 0}\frac{\frac{d}{d\gamma}\ln[\alpha K^\gamma + (1-\alpha) L^\gamma]}{\frac{d}{d\gamma} \gamma}.$$
Since $a^x= e^{ln(a^x)}$, which equals $e^{x(ln(a)}$, you can then easily take the derivative to obtain $\frac{d}{d x}a^x=ln(a)e^{x(ln(a)}$, which (reversing the previous step) equals $\frac{d}{d x}a^x=ln(a)a^x$