# QuadGK returning zero when bounds Inf

**URL:** <https://discourse.julialang.org/t/quadgk-returning-zero-when-bounds-inf/132648>\
**Category:** General Usage\
**Created:** [September 25, 2025, 6:15am UTC](https://discourse.julialang.org/t/quadgk-returning-zero-when-bounds-inf/132648 "2025-09-25T06:15:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rand5](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rand5/32/867_2.png) [@rand5](https://discourse.julialang.org/u/rand5)\
**Post date:** [September 25, 2025, 6:15am UTC](https://discourse.julialang.org/t/quadgk-returning-zero-when-bounds-inf/132648/1 "2025-09-25T06:15:54Z")

</div>

Any help understanding the behavior of QuadGK here would be greatly appreciated. I have two well behaved functions, `pdf(Normal(1.,0.1),x)` and `cdf(Normal(-3.,0.1),x)` and I’d like to integrate their product.

```julia-auto
quadgk(x -> pdf(Normal(1.,0.1),x)*cdf(Normal(-3.,0.1),x), -50., 50.)

```

returns `(1.0000000000047264, 5.928947342456714e-9)`, more or less as expected, but

```julia-auto
quadgk(x -> pdf(Normal(1.,0.1),x)*cdf(Normal(-3.,0.1),x), -50., Inf)

```

returns `(0.0, 0.0)`. I would have expected to get `1` again since there isn’t much going on in the region `[50,Inf]`.

---

<div class="post-metadata">

**Author:** ![ForceBru](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forcebru/32/21389_2.png) [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Post date:** [September 25, 2025, 6:26am UTC](https://discourse.julialang.org/t/quadgk-returning-zero-when-bounds-inf/132648/2 "2025-09-25T06:26:13Z")

</div>

> [@rand5](#):
>
> there isn’t much going on in the region `[50,Inf]`

Indeed, the integrand is basically zero for the majority of the interval. I think QuadGK samples quadrature nodes adaptively and misses the region where the integrand is non-zero. I also run into this from time to time when numerically computing CDFs by integrating PDFs. I think I solved this by adding a few additional quadrature nodes around the mode:

```
quadgk(x->.., -50, MODE, Inf)

```

This usually works fine.
