# Double integration with dependent bounds

Dear all,

I am trying to calculate value of a integral with definite bounds but the integrand is another integral, and one of the bounds of this second integral is the variable of the first integral. I am attaching representative picture.

\int_{9.5}^{10.5}dx\ x \int_{1}^0 dy \ y

How I can write this as a function? Thank you soo much for your help.

Cheers,
morbik

ROOT Version: 6.24/16
Platform: mac os x 64
Compiler: clang 13.1.6

Dear @Wile_E_Coyote, thank you a lot for always replying. I have done the change of variables but actually it couldn’t solve my problem as far as understand. Maybe the representative function was too easy. My function is bit more complicated
\int_{9.5}^{10.5}da \frac{1}{x} \int_{0}^{1}dt\ a*t*sin(x \int_{1}^{0}dk\ a*t*k) * sph\_bessel(x,x*\int_{1}^{0}dl\ a*l)

I am aware this is too complicated maybe, but the thing is that I want to draw this function over x that extens from 0 to 1000, and hopefully at one point I want to do a fit with this function. And since I cannot just take all the integrals outside as in the case of other posts, I feel like I cannot do this with ROOT, would that be corrrect? Do you think I should try to do it with RooFit? I am completely open to any suggestions.

Cheers,
morbik

Dear @Wile_E_Coyote,

I have checked all of thet page. But I think it doesn’t cover my problem. I am sorry if I am missing something. But the thing is, I cannot write my function as

\int_{0}^1\int_{0}^1\int_{0}^1\int_{0}^1dxdydzdt\ x * y * z * t

it is more of the form

\int_{9.5}^{10.5}da \frac{1}{x} \int_{0}^{1}dt\ a*t*sin(x \int_{1}^{0}dk\ a*t*k) * sph\_bessel(x,x*\int_{1}^{0}dl\ a*l)

Meaning that I cannot just say write down one integrate. Sorry if it is not clear, or if I am missing something very little.

Cheers,
morbik

The integral over “dl” is just “-a/2.” and the integral over “dk” is just “-a*t/2.”.
Possibly you could also “simplify” the remaining integrals → WolframAlpha

BTW. I don’t know what kind of variable “x” is (sph_bessel” expects an “unsigned int” as the first parameter and a non-negative “double” as the second parameter).

Thank you a lot, but the thing is that integral I have written over here is representative. It is actually quite complicated. I cannot perform these integrals by hand easily, WolframAlpha exceeds the maximum integration time, and I have tried over Mathematica too but the result is too ugly to type to ROOT by hand all the time. And I will be doing many of them while I try to develop the theory.

Anyhow, I guess I will continue to think. Thank you so much again.

Cheers,
morbik