# An integral with limits being a funtion of a parameter.

Could anyone please explain / derive this formula for me? I encountered it in a probability textbook but can't understand it:

Suppose we have an integral in the following form: $$R(\alpha) = \int_{a(\alpha)}^{b(\alpha)} r(\alpha , x)dx$$ Then, $$\frac{dR(\alpha)}{d\alpha} = -r(\alpha , a(\alpha)) \frac{da(\alpha)}{d\alpha} + r(\alpha , b(\alpha)) \frac{db(\alpha)}{\alpha} + \int_{a(\alpha)}^{b(\alpha)} \frac{\partial r(\alpha, x)}{\partial \alpha} dx$$