# Numeric antiderivative for a noncontinuous function using ODEProblem

**URL:** <https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751>\
**Category:** Numerics\
**Created:** [March 10, 2025, 9:00am UTC](https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751 "2025-03-10T09:00:07Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![nilsbecker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilsbecker/32/12157_2.png) [@nilsbecker](https://discourse.julialang.org/u/nilsbecker)\
**Post date:** [March 21, 2025, 2:10pm UTC](https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751/8 "2025-03-21T14:10:52Z")

</div>

after some digging i think the following would give me a foot in the door with ApproxFun.jl

```julia
using ApproxFun
function approx_piecewise(f::Function, points::Vector{T}) where T<:Real
  segs = (Segment(a, b) for (a, b) in zip(points, points[2:end]))
  Fun(f, union(segs...))
end

```

here, points is the list of points of discontinuity, flanked by the left and right boundaries of the support of the function `f` to be interpolated

---

_[View the full topic](https://discourse.julialang.org/t/numeric-antiderivative-for-a-noncontinuous-function-using-odeproblem/126751)._
