I am trying to solve all steps in a economics paper , but after spending two days with the same differentiation Im losing faith. Can someone out there help me? The problem:
Differentiate: $$ \begin{align} &R_{pg}(w) = \left(\frac{r + \mu + \delta_g}{r + \mu + \delta_p}\right)w \\ &+\left( \left(\frac{r + \mu + \delta_g}{r + \mu + \delta_p}\right)\lambda_{pp} - \lambda_{gp}\right) \int_{w}^{\infty} W'_{p}(x)(1 - F_{p}(x)) \, dx \\ &+\left( \left(\frac{r + \mu + \delta_g}{r + \mu + \delta_p}\right)\lambda_{pg} - \lambda_{gg}\right) \int_{R_{pg}(w)}^{\infty} W'_{g}(x)(1 - F_{g}(x)) \, dx \end{align} $$
additional info: $$ W'_{p}(x) = \left[r + \mu + \delta_{p} + \lambda_{pp} (1 - F_{p}(w)) + \lambda_{pg} (1 - F_{g}(R_{pg}(w)))\right]^{-1} $$ $$ W'_{g}(x) = \left[r + \mu + \delta_{g} + \lambda_{gp} (1 - F_{p}(R_{gp}(w))) + \lambda_{gg} (1 - F_{g}(w))\right]^{-1} $$
The result should be: $$ R'_{pg}(w) = \frac{r + \mu + \delta_g + \lambda_{gp}(1 - F_{p}(w)) + \lambda_{gg}(1 - F_{g}(R_{pg}(w)))}{r + \mu + \delta_p + \lambda_{pp}(1 - F_{p}(w)) + \lambda_{pg}(1 - F_{g}(R_{pg}(w)))} $$
(I left a couple of terms out as they should not depend on w.)