# Maximum of a continous function

**URL:** <https://discourse.julialang.org/t/maximum-of-a-continous-function/115258>\
**Category:** General Usage\
**Created:** [June 5, 2024, 8:30pm UTC](https://discourse.julialang.org/t/maximum-of-a-continous-function/115258 "2024-06-05T20:30:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmichelenstrofer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cmichelenstrofer/32/44392_2.png) [@cmichelenstrofer](https://discourse.julialang.org/u/cmichelenstrofer)\
**Post date:** [June 5, 2024, 8:30pm UTC](https://discourse.julialang.org/t/maximum-of-a-continous-function/115258/1 "2024-06-05T20:30:21Z")

</div>

Packages like `Plots` and `Integrals` are able to determine point spacing by themselves (I imagine it is some sort of adaptive algorithm based on how quickly the function is changing). I would imagine that something similar could be done to obtain the maximum value of a continuous function but can’t find anything that does this. If it works for things like integrals… I would imagine it should work for finding the value.location of the maximum. Any thoughts?

---

<div class="post-metadata">

**Author:** ![lxvm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lxvm/32/50010_2.png) [@lxvm](https://discourse.julialang.org/u/lxvm)\
**Post date:** [June 6, 2024, 11:44am UTC](https://discourse.julialang.org/t/maximum-of-a-continous-function/115258/2 "2024-06-06T11:44:54Z")

</div>

Maximizing a function is considered an optimization problem whereas integration is usually a function approximation problem. There are many optimization (meta) packages available in Julia, for example NLopt.jl, that you could try out. If your function is not only continuous, but also differentiable, optimization via the gradient is also efficient and allows additional techniques, such as rootfinding (see NonlinearSolve.jl).

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [June 6, 2024, 12:16pm UTC](https://discourse.julialang.org/t/maximum-of-a-continous-function/115258/3 "2024-06-06T12:16:48Z")

</div>

The most well-known optimization package is Julia is arguably Optim.jl, which is also a native Julia package.
