I am trying to differentiate:
$p_2(u-\ln(\frac{p_2}{p_1}) +1)$ with respect to $p_2$
expanding the brackets I get $p_2u-p_2\ln(p_2)-p_2\ln(p_1)+p_2$
the answer I should be getting is $u-\ln(p_2)-\ln(p_1)$, however I am getting $u-\ln(p_2)-\ln(p_1)+1$, can someone show me where I'm going wrong please? I confirmed the result using wolframalpha too.
Kind Regards
We get
$$\frac{\partial}{\partial p_2}p_2\left(\left(u-\ln\left(\frac{p_2}{p_1}\right)+1\right)\right) $$ $$= \frac{\partial}{\partial p_2}(p_2u-p_2\ln(p_2)-p_2\ln(p_1)+p_2) $$ $$=u -(\ln(p_2)+1)+\ln(p_1)+1$$ $$=u-\ln(p_2)+\ln(p_1)$$
Since
$$\frac{\partial}{\partial p_2}p_2\ln(p_2) = 1 \cdot \ln(p_2)+\frac{p_2}{p_2}=\ln(p_2)+1$$ by product rule.