The image comes from the book of Dixit and Pindyck "Investment under Uncertainty".

Can someone explain to me how we end up with equation (52) given equations (49)-(51)? Supposedly integration by parts is sufficient but I find it really difficult to get to the final solution. In particular, I am very confused with how to treat the term
$$\int{ \eta x \frac{\partial \varphi}{\partial x} \exp(-\theta x) }dx$$
Assuming that $\varphi$ goes to zero fast enough at infinity, we find \begin{align*} \int_{\mathbb{R}} \eta x \frac{\partial \varphi}{\partial x} \exp(- \theta x) \, dx &= - \eta \int_{\mathbb{R}} \varphi(x) \frac{\partial}{\partial x}\{x \exp(-\theta x) \} \, dx \\ &= - \eta \int_{\mathbb{R}} \varphi(x) \exp(-\theta x) \, dx + \eta \theta \int_{\mathbb{R}} x \varphi(x) \exp(- \theta x) \, dx \\ &= - \eta M(\theta) + \eta \theta \frac{\partial M}{\partial \theta}, \end{align*} where I have assumed that $\varphi$ is nice enough that I can differentiate under the integral sign to obtain $\frac{\partial M}{\partial \theta} = \frac{\partial}{\partial \theta} \left\{ \int_{\mathbb{R}} \varphi(x) \exp(- \theta x) \, dx \right\} = \int_{\mathbb{R}} \varphi(x) \frac{\partial}{\partial \theta} \left\{\exp(-\theta x) \right\} \, dx = - \int_{\mathbb{R}} x\varphi(x) \exp(- \theta x) \, dx$.