How to take the derivative of the following expression I am taking macro course this Fall and my calculus is quite rusty. So in the lecture notes they derive the following:
$$
\begin{split}
MPL&=\frac{dY}{dL}\\&=\frac{d(ALf(k))}{dL}\\&=Af(k)+ALf′(k)(−K)/(L^2A)\\&=A(f(k)−kf′(k))\\&=w
\end{split}
$$
Specifically, I don't quite understand how they got $Af(k) + ALf'(k) (-K)/(L^2A)$ from $d(ALf(k))/dL?$
Let me also clarify that k = K/AL
Honestly, I am stuck at this point and guess will be doing a lot of differentiation like this during the entire course. Would really appreciate if someone could clarify the differentiation part.
 A: In this case there is used the so called 'chain rule': if $f(x)$ is depending from the variable $x$, but $x(t)$ depends from $t$, then $f(x(t))$ depends from $t$, and it has sense to talk about the derivative $\frac{df}{dt}$ which is calculated by $$f'(t)=\frac{df}{dt}=\frac{df}{dx}\frac{dx}{dt}.$$
You also need to have in mind the formula $(f(x)g(x))'=f'(x)g(x)+f(x)g'(x).$
On your case, since $k=\frac{K}{AL},$ $k$ depends on L and so does $f(k).$ Then you have:
$$\frac{dALf(k)}{dL}=AL'f(k)+AL\frac{df(k)}{dL}=Af(k)+AL\frac{df(k)}{dk}\frac{dk}{dL}=Af(k)+ALf'(k)\frac{-K}{AL^2}.$$
A: I interpret that $A$ is a constant. We want to calculate the following expression:
$$
\frac{d(A\cdot L \cdot f(k))}{d L}
$$
Notice that there are three terms which are multiplied by each other, and therefore we can use the product rule:
$$
\frac{d(A\cdot L \cdot f(k))}{d L} =
\color{blue}{\frac{dA}{dL}}\cdot L \cdot f(k)
 + A \cdot \color{blue}{ \frac{dL}{dL}} \cdot f(k)
+A \cdot L \cdot \color{blue}{ \frac{d f(k)}{dL}}
$$
Notice how each terms in the product is separately differentiated and then the results are added together. A few observations are required here:

*

*$\frac{dA}{dL}=0$, because $A$ is a constant

*$\frac{dL}{dL}=1$

*The term $\frac{df(k)}{dL}$ is a tricky one, because $k$ is a function of $L$. Therefore, we must "multiply and divide by $dk$", to rewrite it as
$$
\frac{df(k)}{dL} = \frac{df(k)}{dk}\cdot \frac{dk}{dL}
$$
This is a term that we can actually compute.

*We need to compute $\frac{dk}{dL}$. We know that $k = \frac{K}{AL}$, so
$$
\frac{dk}{dL} = - \frac{K}{AL^2}
$$
(Does this seem odd? Compare to $f(x)= \frac{1}{x}\Rightarrow f'(x) = - \frac{1}{x^2}$)

Now, we can just plug in the results!
$$
\begin{split}
\frac{d(A\cdot L \cdot f(k))}{d k} &=
 0
 + A \cdot 1 \cdot f(k)
+A \cdot L \cdot \left( - \frac{K}{AL^2} \right)\\
\end{split}
$$
Can you finish it from here?
