# Solving a system of multivariate polynomials (or finding extrema)

**URL:** https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451
**Category:** Numerics
**Tags:** question
**Created:** [February 20, 2024, 1:05pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451 "2024-02-20T13:05:32Z")
**Posts on this page:** 7
**Page:** 1

<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: [February 20, 2024, 1:05pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/1 "2024-02-20T13:05:32Z")

</div>

I have a multivariate (in practice, 2–5 dimensions) function approximated with Chebyshev polynomials. I would like to find _all_ the local extrema of the approximation. This is equivalent to solving the system obtained from partial derivatives, but there may be a more direct method (also, dealing with extrema at endpoints, these are bounded on [-1,1]^n.

Specifically, I have the approximation available as either weighted sums of a Chebyshev basis, or if preferable vectors of

```julia
(i j k ...) => c

```

where c would be the coefficient assigned to x\_1^i x\_2^j x\_3^k \dots.

Is this a tractable problem? I only know a method for the unviariate case ([Boyd 2013](https://epubs.siam.org/doi/10.1137/110838297)).

If yes, what would be the recommended way in Julia?

---

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [February 20, 2024, 1:07pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/2 "2024-02-20T13:07:22Z")

</div>

maybe [https://www.juliahomotopycontinuation.org](https://www.juliahomotopycontinuation.org)

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 20, 2024, 2:21pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/3 "2024-02-20T14:21:32Z")

</div>

I’m pretty sure Chebfun can do this in 2D.

---

<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: [February 20, 2024, 2:28pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/4 "2024-02-20T14:28:30Z")

</div>

[Yes, it can](https://www.chebfun.org/docs/guide/guide14.html). But I am not sure what the algorithm is and if there is a Julia equivalent.

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 20, 2024, 3:56pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/5 "2024-02-20T15:56:22Z")

</div>

I asked Alex Townsend and he said it uses subdivision + Bezout resultants. I’m not sure it’s useful beyond 2D.

---

<div class="post-metadata">

### Author: ![sumiya11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sumiya11/32/207147_2.png) [@sumiya11](https://discourse.julialang.org/u/sumiya11)
#### Post date: [February 20, 2024, 5:53pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/6 "2024-02-20T17:53:03Z")

</div>

Assuming the number of solutions is finite, if it is possible to write out the equations in a standard monomial basis, you can maybe try [Algebraic Systems Solving · AlgebraicSolving.jl (algebraic-solving.github.io)](https://algebraic-solving.github.io/solvers/#AlgebraicSolving.real_solutions-Tuple%7BIdeal%7D)

---

<div class="post-metadata">

### Author: ![kenjudd](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@kenjudd](https://discourse.julialang.org/u/kenjudd)
#### Post date: [January 30, 2025, 9:12pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451/7 "2025-01-30T21:12:45Z")

</div>

The best software for solving polynomial systems is Bertini, PCHPack, Magma, and Singular. Both Mathematica and Maple have commands for solving polynomial systems. juliahomotopycontinuation appears to be a Julia implementation of Bertini, and AlgebraicSolving.jl appears to be a Julia version of Singular and what is in Mathematica and Maple. Before I start using the Julia packages, I want to be sure that they work. Many years ago I had an RA computing Groebner bases with SymPy. That was a total waste of time because SymPy was not reliable. It was also an example of getting what I paid for. Are there systematic efforts to test these Julia packages against alternatives?
