How to simplify or evaluate an integral inside an integral in R?

54 Views Asked by At

I have this double integral to work with:

$$ \int_a^b f(x) \int_0^x g(t)(x-t)dtdx $$

I am rather very weak in calculus and not sure how should I approach to simplify or evaluate it.

For numerical evaluation I am using R but I believe this is not in a form where I can use the same approach to evaluate the double integral in the following form for example:

$$ \int_a^b\int_0^xf(x)g(t)(x-t)dtdx $$

Any help would be highly appreciated.

Update: Functions are added in the following image. f(x) basically represents a pdf of a uniform distribution but the g(t) is a bit more complicated.

enter image description here