# \#polynomials

**URL:** https://discourse.julialang.org/tag/polynomials/432.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Julia analog to R's poly function, orthogonal polynomials by QR decomposition](https://discourse.julialang.org/t/julia-analog-to-rs-poly-function-orthogonal-polynomials-by-qr-decomposition/128640)

<div class="topic-metadata">

**Author:** [@Daniel\_Johansson](https://discourse.julialang.org/u/Daniel_Johansson)\
**Replies:** 24\
**Last updated:** [April 22, 2026, 3:57pm UTC](https://discourse.julialang.org/t/julia-analog-to-rs-poly-function-orthogonal-polynomials-by-qr-decomposition/128640 "2026-04-22T15:57:18Z")

</div>

Hey guys! Im trying to replicate some existing R code in julia for a proyect, but such R code depends on the stats base poly function which, given a collection of points, it computes orthogonal polynomials evaluated at …

---

## [Degree of Chebyshev polynomial off by one](https://discourse.julialang.org/t/degree-of-chebyshev-polynomial-off-by-one/136627)

<div class="topic-metadata">

**Author:** [@CFBaptista](https://discourse.julialang.org/u/CFBaptista)\
**Replies:** 4\
**Last updated:** [April 8, 2026, 10:12pm UTC](https://discourse.julialang.org/t/degree-of-chebyshev-polynomial-off-by-one/136627 "2026-04-08T22:12:57Z")

</div>

According to Wikipedia pages Chebyshev polynomials and Chebyshev nodes a Chebyshev polynomial of the first kind of degree n has n roots. However, in BarycentricInterpolation.jl I get: using BarycentricInterpolation no…

---

## [Polynomial optimization without sum of squares](https://discourse.julialang.org/t/polynomial-optimization-without-sum-of-squares/130478)

<div class="topic-metadata">

**Author:** [@joemaik](https://discourse.julialang.org/u/joemaik)\
**Replies:** 11\
**Last updated:** [July 10, 2025, 1:24pm UTC](https://discourse.julialang.org/t/polynomial-optimization-without-sum-of-squares/130478 "2025-07-10T13:24:13Z")

</div>

TL-DR: I would like to solve a linear program, but the problem itself involves multivariate polynomials. So I need tools to transform polynomials to their vectors of coefficients and back. Moreoever, in the end, after so…

---

## [Factor polynomial](https://discourse.julialang.org/t/factor-polynomial/110926)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 5\
**Last updated:** [May 8, 2025, 1:43pm UTC](https://discourse.julialang.org/t/factor-polynomial/110926 "2025-05-08T13:43:32Z")

</div>

I want to factor(x^5 + x + 1) into (x^3 - x^2 + 1)(x^2 + x + 1). Wolfram can do it, is there a Julia package that can? AbstractAlgebra.jl has a function called factor but I can’t figure out how to use it. Polynomials.j…

---

## [Symbolics + Gröbner basis](https://discourse.julialang.org/t/symbolics-grobner-basis/127706)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 24\
**Last updated:** [April 7, 2025, 1:15pm UTC](https://discourse.julialang.org/t/symbolics-grobner-basis/127706 "2025-04-07T13:15:20Z")

</div>

I’m trying to find the roots of some multivariable polynomials with parameters. Just to illustrate the problem, suppose I have 2 equations, say: 0 = x^2y + 2xy - a \\\\ 0 = xy - xy^3 So I try to do the following: using…

---

## [Truncated power series in ApproxFun.jl](https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 10\
**Last updated:** [January 11, 2025, 1:09pm UTC](https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593 "2025-01-11T13:09:04Z")

</div>

I gave ApproxFun.jl another look. As far as I can see, polynomials of truncated power series in ApproxFun.jl (requires for e.g. the Duffing equation) are poorly documented. Do I overlook something?

---

## [Memory-free multivariate polynomials](https://discourse.julialang.org/t/memory-free-multivariate-polynomials/117361)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 26\
**Last updated:** [December 10, 2024, 12:26pm UTC](https://discourse.julialang.org/t/memory-free-multivariate-polynomials/117361 "2024-12-10T12:26:41Z")

</div>

I was looking for a package, that allows higher-order coordinate transforms. The idea would be an interface somewhat related to Base.evalpoly but capable of handling multiple dimensions. The use-case is non-linear deform…

---

## [Evalpoly without coefficients: ugly errors, zero polynomial?](https://discourse.julialang.org/t/evalpoly-without-coefficients-ugly-errors-zero-polynomial/97666)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [November 28, 2024, 11:56am UTC](https://discourse.julialang.org/t/evalpoly-without-coefficients-ugly-errors-zero-polynomial/97666 "2024-11-28T11:56:30Z")

</div>

Consider calls such as these: julia\> evalpoly(3, ()) ERROR: BoundsError: attempt to access Tuple{} at index \[0\] Stacktrace: \[1\] getindex(t::Tuple, i::Int64) @ Base ./tuple.jl:31 \[2\] macro expansion @ ./math.jl:1…

---

## [Issue with DynamicPolynomials and BigFloat coefficients?](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814)

<div class="topic-metadata">

**Author:** [@chkat](https://discourse.julialang.org/u/chkat)\
**Replies:** 2\
**Last updated:** [October 3, 2024, 10:05am UTC](https://discourse.julialang.org/t/issue-with-dynamicpolynomials-and-bigfloat-coefficients/120814 "2024-10-03T10:05:56Z")

</div>

I am experiencing an issue with the latest version of DynamicPolynomials (0.6) when I evaluate a polynomial with BigFloat coefficients at another BigFloat. I isolated a simple example that shows that I get different resu…

---

## [Allocation-efficient calculation of Hermite (and Laguerre) polynomials](https://discourse.julialang.org/t/allocation-efficient-calculation-of-hermite-and-laguerre-polynomials/118220)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 5\
**Last updated:** [August 16, 2024, 7:45am UTC](https://discourse.julialang.org/t/allocation-efficient-calculation-of-hermite-and-laguerre-polynomials/118220 "2024-08-16T07:45:54Z")

</div>

un-XY: I’m working on a project that involves a lot of simulation, for which I need to compute basis-functions based on the simulated quantities repeatedly. I’m writing code that allows me to flexibly mix-and-match vario…

---

## [Symmetry reduction in Sumsofsquares](https://discourse.julialang.org/t/symmetry-reduction-in-sumsofsquares/115727)

<div class="topic-metadata">

**Author:** [@Khashayar-Neshat](https://discourse.julialang.org/u/Khashayar-Neshat)\
**Replies:** 18\
**Last updated:** [June 30, 2024, 11:42pm UTC](https://discourse.julialang.org/t/symmetry-reduction-in-sumsofsquares/115727 "2024-06-30T23:42:55Z")

</div>

I have a simple minimization with symmetry, but Julia gives an error while using symmetry reduction. I want to find the minimum of x\_1^4+x\_2^4+x\_3^4-4x\_1x\_2x\_3+x\_1+x\_2+x\_3. Here is my script: using SumOfSquares using …

---

## [Package for Lagrange interpolation on finite fields](https://discourse.julialang.org/t/package-for-lagrange-interpolation-on-finite-fields/116288)

<div class="topic-metadata">

**Author:** [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Replies:** 7\
**Last updated:** [June 28, 2024, 2:42am UTC](https://discourse.julialang.org/t/package-for-lagrange-interpolation-on-finite-fields/116288 "2024-06-28T02:42:50Z")

</div>

A common point among some Discourse topics on Lagrange interpolation is the non-recommendation due to the Runge’s phenomenon (Edit: or numerical stability). However, that is a problem on real numbers, not on finite fiel…

---

## [Changing polynomial bases](https://discourse.julialang.org/t/changing-polynomial-bases/111238)

<div class="topic-metadata">

**Author:** [@votroto](https://discourse.julialang.org/u/votroto)\
**Replies:** 7\
**Last updated:** [March 8, 2024, 1:43pm UTC](https://discourse.julialang.org/t/changing-polynomial-bases/111238 "2024-03-08T13:43:34Z")

</div>

Hello, I noticed there is a julia package MultivariateBases.jl for finding the bases of multivariate polynomials. Is there a simple way to get the coefficients corresponding to the basis generated basis elements? Thank …

---

## [Multivariate polynomial with symbolic values](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values/109345)

<div class="topic-metadata">

**Author:** [@hugopottinger](https://discourse.julialang.org/u/hugopottinger)\
**Replies:** 3\
**Last updated:** [January 30, 2024, 10:21am UTC](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values/109345 "2024-01-30T10:21:42Z")

</div>

For a multivariate polynomial with symbolic coefficients such as p = ax + bx^2y + cx\*y I require in my code to be able to use functions similar to those in MultivariatePolynomials such as length(p), degree(p,x), coeffi…

---

## [Package for matrix polynomials](https://discourse.julialang.org/t/package-for-matrix-polynomials/107687)

<div class="topic-metadata">

**Author:** [@fph](https://discourse.julialang.org/u/fph)\
**Replies:** 2\
**Last updated:** [December 15, 2023, 10:23pm UTC](https://discourse.julialang.org/t/package-for-matrix-polynomials/107687 "2023-12-15T22:23:22Z")

</div>

What package do you recommend to work with matrix polynomials, i.e., expressions of the form A(x) = A\_0 + A\_1 x + \\dots + A\_d x^d? I will use mainly the coefficients to do linear algebra, so I am interested in a package…

---

## [Using inequalities in a polynomial system in Groebner.jl](https://discourse.julialang.org/t/using-inequalities-in-a-polynomial-system-in-groebner-jl/106651)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [November 24, 2023, 11:19am UTC](https://discourse.julialang.org/t/using-inequalities-in-a-polynomial-system-in-groebner-jl/106651 "2023-11-24T11:19:39Z")

</div>

Groebner.jl is useful for solving a system of polynomial equations. This is about a method of transforming an inequality into an equation, so it could be used with Groebner.jl. Suppose, for example, I have this simple e…

---

## [Multivariate polynomial with symbolic values in the coefficients](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values-in-the-coefficients/84311)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 18\
**Last updated:** [June 11, 2023, 8:12pm UTC](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values-in-the-coefficients/84311 "2023-06-11T20:12:28Z")

</div>

Hello, With Sympy in Python, it is possible to define a polynomial such as x^2 + a\*x^2 + 2/3\*y + b\*y + x\*z + a\*x\*z with symbolic variables x,y,z and also symbolic numbers a,b in the coefficients. In other words this i…

---

## [Laguerre polynomials on GPU](https://discourse.julialang.org/t/laguerre-polynomials-on-gpu/99571)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 27\
**Last updated:** [June 9, 2023, 11:35am UTC](https://discourse.julialang.org/t/laguerre-polynomials-on-gpu/99571 "2023-06-09T11:35:19Z")

</div>

Hello, I’m currently able to calculate the generalized Laguerre polynomials on the CPU using HypergeometricFunctions \_genlaguerre(n, α, x) = binomial(n+α,n) \* HypergeometricFunctions.M(-n, α+1, x) A = rand(1000, 1000)…

---

## [Substituting a TaylorN variable into another TaylorN variable](https://discourse.julialang.org/t/substituting-a-taylorn-variable-into-another-taylorn-variable/96014)

<div class="topic-metadata">

**Author:** [@Vaclav\_Mikeska](https://discourse.julialang.org/u/Vaclav_Mikeska)\
**Replies:** 0\
**Last updated:** [March 13, 2023, 4:43pm UTC](https://discourse.julialang.org/t/substituting-a-taylorn-variable-into-another-taylorn-variable/96014 "2023-03-13T16:43:36Z")

</div>

Let’s have some multivariable polynomials P1 and P2 represented by TaylorN variable from TaylorSeries package, e.g. using TaylorSeries x, y = set\_variables("x y") P1 = TaylorN(\[HomogeneousPolynomial(\[1\]), HomogeneousPo…

---

## [Announcing new package \`CycPols\`](https://discourse.julialang.org/t/announcing-new-package-cycpols/94142)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 0\
**Last updated:** [February 6, 2023, 2:42pm UTC](https://discourse.julialang.org/t/announcing-new-package-cycpols/94142 "2023-02-06T14:42:20Z")

</div>

This package deals with products of Cyclotomic polynomials. Cyclotomic numbers, and cyclotomic polynomials over the rationals or some cyclotomic field, are important in the theories of finite reductive groups and …

---

## [Generation of multivariate polynomial basis with given degree](https://discourse.julialang.org/t/generation-of-multivariate-polynomial-basis-with-given-degree/60757)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 4\
**Last updated:** [January 24, 2023, 2:22pm UTC](https://discourse.julialang.org/t/generation-of-multivariate-polynomial-basis-with-given-degree/60757 "2023-01-24T14:22:07Z")

</div>

Hi, I would like to make a multivariate polynomial with given degree. For example, the bivariate polynomial basis of a vector x = \[x1, y2\] with degree of 2 would be x -\> \[1, x1, x1^2, x2, x2^2, x1\*x2\]. It seems that …

---

## [Rounding the coefficients of a minimax polynomial](https://discourse.julialang.org/t/rounding-the-coefficients-of-a-minimax-polynomial/92873)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 19\
**Last updated:** [January 14, 2023, 7:05pm UTC](https://discourse.julialang.org/t/rounding-the-coefficients-of-a-minimax-polynomial/92873 "2023-01-14T19:05:46Z")

</div>

I’m making a Julia package for automating implementation of univariate real functions using polynomial approximation, but I’m having trouble with rounding the coefficients after a minimax polynomial is found, while prese…

---

## [How to fit a polynomial with a pre-determined degree to a set of points?](https://discourse.julialang.org/t/how-to-fit-a-polynomial-with-a-pre-determined-degree-to-a-set-of-points/91981)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 7\
**Last updated:** [December 27, 2022, 7:44pm UTC](https://discourse.julialang.org/t/how-to-fit-a-polynomial-with-a-pre-determined-degree-to-a-set-of-points/91981 "2022-12-27T19:44:06Z")

</div>

Hi, all I want to approximate a function to a vector v of 99 values so I can evaluate that function over other values. This can be a simple linear interpolation of the 99 values, but I’d fit a polynomial in case other v…

---

## [Exact integral of a polynomial over a simplex](https://discourse.julialang.org/t/exact-integral-of-a-polynomial-over-a-simplex/91132)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 5\
**Last updated:** [December 3, 2022, 8:26pm UTC](https://discourse.julialang.org/t/exact-integral-of-a-polynomial-over-a-simplex/91132 "2022-12-03T20:26:30Z")

</div>

Hello, I wrote a function which computes the exact value of a multivariate polynomial over a simplex. I’m open to any comment on my code. I also implemented this method in Python. I’m sure it is correct, I multi-checke…

---

## [Convert polynomials](https://discourse.julialang.org/t/convert-polynomials/90640)

<div class="topic-metadata">

**Author:** [@irezvyakova](https://discourse.julialang.org/u/irezvyakova)\
**Replies:** 3\
**Last updated:** [November 22, 2022, 11:40am UTC](https://discourse.julialang.org/t/convert-polynomials/90640 "2022-11-22T11:40:55Z")

</div>

Dear all, I cannot overcome just the simpliest example from Julia notes on how to convert special polynomials into a polynomial-type value. Below is the program and the Error. Where is the problem? julia\> using Polynom…

---

## [Zygote differentiation with DynamicPolynomials](https://discourse.julialang.org/t/zygote-differentiation-with-dynamicpolynomials/90064)

<div class="topic-metadata">

**Author:** [@mhar](https://discourse.julialang.org/u/mhar)\
**Replies:** 0\
**Last updated:** [November 10, 2022, 6:12pm UTC](https://discourse.julialang.org/t/zygote-differentiation-with-dynamicpolynomials/90064 "2022-11-10T18:12:47Z")

</div>

My primary question is: I want to write a custom adjoint for something that has a similar structure to the following, but I keep getting errors with my attempts. I think I am getting the types wrong. using DynamicPolyno…

---

## [Error in DynamicPolynomials?](https://discourse.julialang.org/t/error-in-dynamicpolynomials/89196)

<div class="topic-metadata">

**Author:** [@mhar](https://discourse.julialang.org/u/mhar)\
**Replies:** 1\
**Last updated:** [October 24, 2022, 4:31pm UTC](https://discourse.julialang.org/t/error-in-dynamicpolynomials/89196 "2022-10-24T16:31:56Z")

</div>

The following code used to work, but I’m having an issue with it now: using DynamicPolynomials @polyvar var1 var2 v = randn(3); \_mons = monomials(\[var1, var2\], length(v) - 1); p = sum(\_mons .\* v) p + p ERROR: AssertionE…

---

## [Symbolics: how do I create an array of subscripted symbolic variables?](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530)

<div class="topic-metadata">

**Author:** [@mendeli](https://discourse.julialang.org/u/mendeli)\
**Replies:** 2\
**Last updated:** [August 9, 2022, 6:09pm UTC](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530 "2022-08-09T18:09:58Z")

</div>

Is there a way to automatically create an array of subscripted variables given n in Symbolics? For the case n=6, I would like to do what the code below does without having to type out the variables explicitly. using P…

---

## [Problem with SymPy. Symbolic calculation of Sturm chains (Sturm sequence) for polynomials](https://discourse.julialang.org/t/problem-with-sympy-symbolic-calculation-of-sturm-chains-sturm-sequence-for-polynomials/84921)

<div class="topic-metadata">

**Author:** [@mendeli](https://discourse.julialang.org/u/mendeli)\
**Replies:** 2\
**Last updated:** [August 3, 2022, 4:44pm UTC](https://discourse.julialang.org/t/problem-with-sympy-symbolic-calculation-of-sturm-chains-sturm-sequence-for-polynomials/84921 "2022-08-03T16:44:54Z")

</div>

I was using sympy.sturm() to calculate the Sturm functions of a polynomial and came across an error for a 4th degree polynomial using SymPy begin @vars x # Polynomial coefficients c4 = Sym\[1; -4; 8; -8; 4\] # Probl…

---

## [Using nlsolve for roots of Legendre Polynomials in terms of RadauIIA method](https://discourse.julialang.org/t/using-nlsolve-for-roots-of-legendre-polynomials-in-terms-of-radauiia-method/84872)

<div class="topic-metadata">

**Author:** [@Vick](https://discourse.julialang.org/u/Vick)\
**Replies:** 0\
**Last updated:** [July 27, 2022, 1:04pm UTC](https://discourse.julialang.org/t/using-nlsolve-for-roots-of-legendre-polynomials-in-terms-of-radauiia-method/84872 "2022-07-27T13:04:31Z")

</div>

Hi, I need to find root for Legendre polynomials in terms of the RadauIIA method using ClassicalOrthogonalPolynomials, NLsolve function P(x, n) return legendrep(n, x) end function radc(x, s) v = 2 \* x - 1 …

[Next page](https://discourse.julialang.org/tag/polynomials/432.md?match_all_tags=true&page=1&tags%5B%5D=polynomials)
