# Multivariable numerical integration with changing limits

**URL:** https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862
**Category:** Numerics
**Tags:** question
**Created:** [June 30, 2019, 5:15pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862 "2019-06-30T17:15:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sevimora](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@sevimora](https://discourse.julialang.org/u/sevimora)
#### Post date: [June 30, 2019, 5:15pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862/1 "2019-06-30T17:15:13Z")

</div>

Hi!

I am not very proficient in Julia (or in numerical methods, for that matter), so please be forgiving with my ignorance…

I am trying to numerically integrate a function of the form:

\int\_a^b \int\_{\underline x(w)}^{\overline x(w)} f(w,x) dx dw

I see that there are several packages (HCubature, Nintegration) that integrate over more than one dimension, but they seem to do it for a fixed hypercube. So that the limits of integration on x are fixed, and do not depend on the value of w.

is there any way to do this? … I am sure I am not the first person with this problem!!!

Thanks a lot!!

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [June 30, 2019, 5:31pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862/2 "2019-06-30T17:31:40Z")

</div>

> [@sevimora](#):
>
> is there any way to do this? … I am sure I am not the first person with this problem!!!

Transform the problem to a hypercube, eg by mapping [\underline{x}(w), \bar{x}(w)] to [0, 1] using an affine transform that depends on w. Don’t forget to adjust by the Jacobian.

---

<div class="post-metadata">

### Author: ![sevimora](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@sevimora](https://discourse.julialang.org/u/sevimora)
#### Post date: [June 30, 2019, 5:57pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862/3 "2019-06-30T17:57:44Z")

</div>

I’ll try!!! 🙂 Thanks so much!!!

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 1, 2019, 6:42pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862/4 "2019-07-01T18:42:38Z")

</div>

On an unrelated note good to see you diving into Julia, hope my thesis was an inspiration 😉

---

<div class="post-metadata">

### Author: ![sevimora](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@sevimora](https://discourse.julialang.org/u/sevimora)
#### Post date: [July 2, 2019, 5:02pm UTC](https://discourse.julialang.org/t/multivariable-numerical-integration-with-changing-limits/25862/5 "2019-07-02T17:02:34Z")

</div>

🙂
