Questions tagged [polynomials]

Questions on the functionality operating on polynomials

981 questions
20
votes
0 answers

Changes to Coefficient function in v10.2

In the version Mathemaica 10.4, I am very surprised that the core function Coefficient has changed, e.g., Coefficient[3 x x + 8 y y - 24 x y, 2 x y] 0 In previous versions (e.g. v9.0.1, v10.1.0), the result was -12. On the website wolframalpha,…
Orders
  • 1,247
  • 11
  • 20
18
votes
5 answers

How do I find the degree of a multivariable polynomial automatically?

I have a very simple question which appears not to have already been answered on this forum. Is there built-in functionality that returns the degree of a multivariable polynomial? For example if the polynomial is s1 + s2^2 s3 + s3^2 s4^7 I want…
Rob2181
  • 527
  • 3
  • 11
12
votes
4 answers

Any efficient way to make complete homogeneous symmetric functions in Mathematica?

We do have elementary symmetric functions, SymmetricPolynomial[k, {x_1, ..., x_n}] . But I didn't find complete homogeneous symmetric functions. The induction method to compute $h_n$ from $e_i$ and $h_j$ ($j\leq n-1$) is not that efficient. Is…
Osiris Xu
  • 1,019
  • 1
  • 9
  • 13
9
votes
3 answers

Coefficients returned from CoefficientRules

When I used an older version of Mathematica, CoefficientRules returned coefficients as entered, say x^2 +2x -4 y + 13., it returned {{2,0}->1,{1,0}->2,{0,1}->-4,{0,0}->13.} with all coefficients returned as integers except the last one. I used this…
kent
  • 139
  • 3
9
votes
7 answers

What is the inverse of CoefficientList?

I have numbers in vector notation. I need to get polynomial notation from them. My numbers are {0, 1, 23, 5, 15, 0, 0, 0}. I want to get $x + 23x^2 + 5x^3 + 15x^4$ from this list. How can I get that polynomial?
Serkan
  • 183
  • 4
8
votes
4 answers

Unexpected behavior using FromDigits to reconstruct polynomial

I have an issue with the reconstruction of a polynomial using FromDigits. The documentation of the function CoefficientList says: Fold the operation for multivariate polynomials: CoefficientList[(x + 2 y)^3, {x, y}] {{0, 0, 0, 8}, {0, 0, 12, 0},…
Klodd
  • 183
  • 4
8
votes
5 answers

Convert polynomial to Chebyshev

I want to convert a polynomial in "standard form" to Chebyshev form. Here's one way to do it: (* My polynomial *) pa = Sum[a[i]*t^i, {i, 0, 5}] (* "standard form" coefficients of Chebyshev polynomial of same degree *) pb =…
user1722
7
votes
2 answers

Write a function that returns the coefficient of x^n

Write a function C[p_, x_, n_] that returns the coefficient of $x^n$ in the polynomial equation. C[p_, x_, n_] := ... If we call C[7 x^2 - 3 x^3, x, 2], the output should be 7. I don't want to use the Coefficient[] function in Mathematica, I just…
ferrou
  • 125
  • 4
7
votes
0 answers

Why is Resultant so slow?

I need to calculate the discriminant of a polynomial $f$ f=(-1+a)^3 (-776887+6874047 a-27016044 a^2+61683852 a^3-89995170 a^4+87469410 a^5-57357788 a^6+24894300 a^7-6591327 a^8+816631 a^9)+(-1+a)^3 (-70993+1896501 a-11839806 a^2+35821722…
lapcal
  • 531
  • 2
  • 7
6
votes
1 answer

Counting the number of terms in a polynomial using Length command

I have the following polynomial which depends on $n$: poly = (Sum[(i - 1) y[i], {i, 1, n, 1}])^2 - Sum[(i - 1)^2 y[i]^2, {i, 2, n, 1}] // Expand; The Mathematica Length command can be used to determine the length of poly for an arbitrarily chosen…
Sid
  • 977
  • 1
  • 6
  • 15
6
votes
1 answer

Unexpected result for Coefficient[]

Is this just me being stupid, or is this a known bug in Mathematica? Coefficient[2 x + 2 y, x + y] gives 0, while Coefficient[2(x + y), x + y] gives 2. The documentation says that it should work whenever the expression is expanded or not... I can…
Per Alexandersson
  • 2,469
  • 15
  • 19
6
votes
1 answer

Removing terms with odd degrees in polynomial

I have a polynomial in four variables and I would like to eliminate all terms that are odd in at least one of these variables. For example, if $p(x,y,z,t)=3x^2y+y^4z^2+x^2yt + x^2t^2$, then the only part that should remain is $y^4z^2+x^2y^2$ (since…
mikis
  • 381
  • 1
  • 6
6
votes
2 answers

Determine whether a polynomial is a perfect square

I want to check for a polynomial whether it is a perfect square. Using the functions for polynomial factoring and decomposition, this is possible by first applying FactorList, after which you can check all these terms whether there is a polynomial…
Stapler
  • 163
  • 4
6
votes
4 answers

Removing terms of certain degree in multivariable polynomial

I am new to Mathematica and I have what I am sure is a basic question, which I unfortunately have not been able to figure out. I am trying to keep terms in a polynomial that are of the same degree only. For example, if I have a polynomial in the…
Nick Murphy
  • 189
  • 4
5
votes
4 answers

Approximate GCD

I have several pairs of bivariate polynomials that I want to find if they have common factors. The polynomials, however, have numerical errors because the coefficients are some algebraic numbers that I cannot obtain very easily so I represent them…
quantum
  • 287
  • 1
  • 6
1
2 3 4 5 6