Log-log elasticities estimation A simple linear regression model is given by $$\log(q)=b_1+b_2\log(p)+e$$ 
In this model $b_2$ is the derivative of $\log(p)$ with respect to $\log(p)$, that is, $$b_2=\frac{d \log(q)}{d \log(p)}=\frac{dq/q}{dp/p}$$
Question:
How do we obtain the the last equation? The first part of the last equation is clear. How do we obtain the second part?
 A: Chain Rule:
\begin{align*} \frac{d \log Q}{d \log P} &= \frac{d \log Q}{dQ}\frac{dQ}{dP}\frac{dP}{d\log P}\\ 
&=\frac{1}{Q}\frac{dQ}{dP}P
\end{align*}
Where last step you apply that $\frac{d \log Q}{dQ} = \frac{1}{Q}$ and that $\frac{dP}{d \log P} = P $.

If above argument made you feel uncomfortable, try this.
I'm going to use $Q$ to refer to quantity, $P$ to refer to price, $q$ to refer to the logarithm of quantity and $p$ to refer to the logarithm of price.
Let's say we have three functions:


*

*$q(Q) = \log Q$

*$Q(P)\quad$ this is the supply curve or the demand curve

*$P(p) = e^p\quad $ (hence $\log P = p$)


Consider function $q(Q(P(p)))$
By the Chain Rule:
\begin{align*}
\frac{dq}{dp} &= \frac{dq}{dQ} \frac{dQ}{dP} \frac{dP}{dp}
\end{align*}
That's just the standard-rule for the composition of a function. Then you apply $\frac{d \log Q}{dQ} = \frac{1}{Q}$. Also observe that $\frac{d \log P}{dP} = \frac{1}{P}$ hence $\frac{dP}{d \log P} = P$
$$ \frac{dq}{dp} = \frac{P}{Q} \frac{dQ}{dP} $$
