# Approximate inverse of a definite integral

**URL:** <https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181>\
**Category:** Numerics\
**Tags:** question, integral\
**Created:** [June 22, 2022, 12:21pm UTC](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181 "2022-06-22T12:21:43Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Post date:** [March 31, 2023, 2:01pm UTC](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181/7 "2023-03-31T14:01:15Z")

</div>

I am still not sure what is the best (i.e. maximal accuracy) way to do that.  
In this [post](https://discourse.julialang.org/t/how-do-i-do-a-fast-cumulative-integration/85574/6) @stevengj explains why it is better to approximate the function you want to integrate (if you are interested in a cumulative integration).

So I am trying that (following the example in the same [thread](https://discourse.julialang.org/t/how-do-i-do-a-fast-cumulative-integration/85574/5)).  
I am also interested in the inverse function h^{-1}. So I use Newton’s Method to invert it for any value that I am interested in. I am not happy with the accuracy I get. Part of the complication, in my case, is that the function f(x) is actually a function that depends on another parameter f(x, a), and then for different a's I do not get consistent results.

I think the main problem comes from the approximation near the boundaries of the integral \int\_{x\_1}^{x\_2} f(x') dx'. Is there any way to increase the approximation of [ApproxFun.jl](https://juliaapproximation.github.io/ApproxFun.jl/latest/), or to account for the boundaries x\_1, x\_2 better?

Alternatively, is there a better way (more accurate) to compute this integral and its inverse?

---

_[View the full topic](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181)._
