# 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

1 Like

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

1 Like

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).

1 Like

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