Questions on the functionality operating on polynomials

learn more… | top users | synonyms (1)

32
votes
6answers
4k views

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$. When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
18
votes
5answers
681 views

How do I reassign canonical ordering of symbols?

I have a big polynomial that evaluates to: $$A^2 e^2 \phi ^- \phi ^++A e \phi ^- \phi ^+ c_{2 w} g_Z+\frac{1}{2} A e g h W^- \phi ^+ +\ll13\gg,$$ which is supposed to represent some terms in the ...
14
votes
2answers
211 views

What are Root objects with multiple polynomials?

In Mathematica 9 a new flavor of Root object with multiple polynomials was introduced. For example, ...
13
votes
3answers
548 views

How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
13
votes
1answer
524 views

Funny behaviour when plotting a polynomial of high degree and large coefficients

I am trying to plot a polynomial of degree 29 on the domain [0,1], with fairly large coefficients: ...
12
votes
7answers
2k views

How do I replace a variable in a polynomial?

How do I substitue z^2->x in the following polynomial z^4+z^2+4? z^4+z^2+4 /. z^2->x ...
12
votes
2answers
489 views

Surprises simplifying simple polynomials

I came across some somewhat surprising behavior of Simplify today, on something very simple. Let's take two cubic polynomials that we know have the same value: ...
11
votes
3answers
1k views

Computing the genus of an algebraic curve

How-to compute the genus of an algebraic curve in Mathematica ? In my case the algebraic curve is explicitly defined by a polynomial.
11
votes
4answers
290 views

How to replace every possible $A+B$ and $AB$ in expansion of $(A+B)^{10}-A^{10}-B^{10}$ with $x$ and $y$, respectively?

I would like to replace every possible $A+B$ and $AB$ in expansion of $(A+B)^{10}-A^{10}-B^{10}$ with $x$ and $y$, respectively. How to do it with the simplest code in Mathematica? For example, ...
11
votes
2answers
491 views

Factorizing polynomials over fields other than $\mathbb{C}$

I'd like to take a polynomial in $\mathbb{Z}_5[x]$ of the form $ax^2+bx+c$ and factor it into irreducible polynomials. For example: Input... x^2+4 Output... ...
11
votes
4answers
749 views

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 ...
11
votes
4answers
692 views

Is there a way to Collect[] for more than one symbol?

Oftentimes you find yourself looking for polynomials in multiple variables. Consider the following expression: a(x - y)^3 + b(x - y) + c(x - y) + d as you can ...
11
votes
1answer
188 views

ToNumberField won't recognize Root as an explicit algebraic number

In Mathematica 9.0.1, it appears that ToNumberField will not always recognize a Root object as an explicit algebraic number. ...
11
votes
1answer
501 views

Rearranging a Polynomial

In Mathematica 8.04 on Windows, I want to display a formula in standard textbook format. The formula is the variance of an $N$-security portfolio. For two securities it is: ...
10
votes
2answers
221 views
10
votes
1answer
584 views

Find roots of polynomial in field extension $GF(2^n)$?

How can I find roots of polynomial in extension field $GF(2^n)$?
9
votes
3answers
345 views

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 ...
9
votes
1answer
408 views

Gröbner basis on a particular set of equations

This question is very similar in gist to equation solving with GroebnerBasis, but hopefully when I say that I make the system a little larger I mean little. I have ...
9
votes
3answers
453 views

How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?

The first three expressions evaluate as expected and the polynomial is displayed in what I would call "textbook" form. The last expression, however, switches the order of terms. Mathematica employs ...
8
votes
4answers
526 views

“Evaluating” polynomials of functions (Symbols)

I want to implement the following type evaluation symbolically $$(f^2g + fg + g)(x) \to f(x)^2 g(x) + f(x) g(x) + g(x)$$ In general, on left hand side there is a polynomial in an arbitrary number of ...
8
votes
3answers
956 views

Checking if the roots of a function are real

I'm trying to determine if the roots of a function are real. How would you do that? (In particular I'm interested in verifying that the roots of LegendreP[6, x] ...
8
votes
4answers
5k views

Factoring polynomials to factors involving complex coefficients

I've run into some problems using Factor on polynomials with complex coefficient factors. Reading the documentation it looks like it only factors over the ...
7
votes
3answers
1k views

First positive root

Simple question but problem with NSolve. I need help how to extract first positive root? For example: ...
7
votes
2answers
367 views

How to deduce a generator formula for a polynomial sequence?

Consider a polynomial sequence $\{p_n\}$ generated by some (simple) rule: $$ \begin{array}{l} p_1(x)=x \\ p_2(x)=2 x-x^2 \\ p_3(x)= x^3-3 x^2+3 x \\ p_4(x)=-x^4+4 x^3-6 x^2+4 x \\ p_5(x)= x^5-5 ...
7
votes
1answer
170 views

GroebnerBasis without specifying variables

All the examples in the Mathematica documentation specify that the syntax for the GroebnerBasis command is ...
7
votes
1answer
392 views

Writing an expression as sum of squares of expressions

Suppose we have a symmetric homogeneous polynomial expression $P$ in $X=(x_1,\cdots, x_n)$. I want to check whether there are functions $g(X)$ so that $P$ is of the form $\sum _{1\le i<j\le n} ...
7
votes
0answers
101 views

Apart may use Padé method: what's that?

How does Apart work? The page tutorial/SomeNotesOnInternalImplementation#7441 says, "Apart ...
6
votes
3answers
543 views

What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$?

What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$? I want to evaluate It and I've tried to use the most obvious way: simply typing and evaluating $(x+y)^2$, But it gives me only ...
6
votes
8answers
798 views

Defining a function that completes the square given a quadratic polynomial expression

How can I write a function that would complete the square in a quadratic polynomial expression such that, for example, CompleteTheSquare[5 x^2 + 27 x - 5, x] ...
6
votes
5answers
202 views

Lowering the degree of an polynomial with an assumption that the polynomial has a factor x^2+ax+b

Let's assume $ x^{10}+x^5+1 $ has a factor $x^2+ax+b$ Then, If $x^2=-ax-b$, $ x^{10}+x^5+1 =0$. If we successively apply $x^2=-ax-b$ to $ x^{10}+x^5+1 $, we can make $ x^{10}+x^5+1 $ to degree 1, ...
6
votes
2answers
327 views

3D Plot: Number of Roots in x of a polynomial in x, a, b and c

I have a polynomial in four variables x,a,b and c. The number of roots of the polynomial in x depends of the choice of a, b and c. I would like to have a 3D-Plot with a, b and c on the axes, while the ...
6
votes
2answers
615 views

Why does Expand not work within a function?

I'm writing this fairly simple function: ...
6
votes
4answers
418 views

How to collect terms with positive powers in polynomial

I am trying to collect all terms with non-negative powers of $x$ in polynomials like $\frac{1}{x^2}\left(a x^2+x^{\pi }+x+z\right)^2$ First expand the polynomial ...
6
votes
2answers
220 views

Why does PolynomialQ[x^n, x] return False?

From what I can see PolynomialQ will return False whenever some exponent is another variable such as here: ...
6
votes
2answers
153 views

Finding common roots of a specific system of polynomials

Some of my colleges are interested in finding common zeros of the following four polynomials: ...
6
votes
1answer
279 views

How to express the original ideal elements in the Groebner basis?

Suppose I call GroebnerBasis[{f1, f2, ...}, {x1,x2, ...}] The output is a list {g1,g2,...} For each $g_j$, there should be ...
6
votes
1answer
150 views

The third argument of the Root function

Consider the roots of an arbitrary indecomposable polynomial: sol = Solve[x^5 + 2 x + 1 == 0, x] The returned expression is ...
6
votes
1answer
228 views

A problem with polynomial root finding

I use the expression ...
5
votes
5answers
983 views

Series expansion in terms of Hermite polynomials

I am trying to expand a polynomial in terms of orthogonal polynomials (in my case, Hermite). Maple has a nice built-in function for this, ChangeBasis. Is there a ...
5
votes
2answers
211 views

How to find monotonically increasing intervals of a function

I tried this code, but not working Clear[f]; f[x_] := x^3 - 3 x + 2; ForAll[{x1, x2}, x1 < x2, f[x1] < f[x2]] Reduce[%, {x1, x2}, Reals] I expected the ...
5
votes
4answers
1k views

How to get exact roots of this polynomial?

The equation $$ 64x^7 -112x^5 -8x^4 +56x^3 +8x^2 -7x - 1 = 0 $$ has seven solutions $x = 1$, $x = -\dfrac{1}{2}$ and $x = \cos \dfrac{2n\pi}{11}$, where $n$ runs from $1$ to $5$. With ...
5
votes
1answer
337 views

How can I plot a Chebyshev spiral?

The Chebyshev polynomials T_n of the first kind are a certain set of orthogonal polynomials. They can be defined by T_n(cos(x))=cos(nx), the first of them are T_0(x) = 1 T_1(x) = x T_2(x) = ...
5
votes
1answer
475 views

Finding the characteristic polynomial of a matrix modulus n

Given a square matrix, is it possible to calculate its characteristic polynomial modulo n? Unfortunately, this function ...
5
votes
1answer
184 views

How to substitute the following conditions into an expression?

I have an expression: $p=a\;b\; x + b^2\; y + a\;c\; z$. I want to substitute $a\;b=1$, $b^2 = 2$ and $a\;c = 4$ to obtain $p = x + 2y + 4z$. How can I tell Mathematica to do that? I dont know how to ...
5
votes
2answers
240 views

How can I make the output from Solve look nice?

I have a problem with presenting solutions. Roots of 4th order polynomials are big expressions. Is there a way to present the roots, s2 and s3, in normal form with some substitutions? Maybe a way to ...
5
votes
1answer
655 views

Polynomial Approximation from Chebyshev coefficients

I would like to expand a function $f(r)$ in the domain $[0,R]$, around the points $r =0$, and $r = R$ in the following manner $f(r = 0) = \Sigma_{i=0,i = even}^{imax} f_i (r/R)^i$ and $f(r = R) = ...
5
votes
3answers
3k views

Get polynomial interpolation formula

I'm attempting to get a polynomial interpolation formula out of Mathematica but I am absolutely lost. I stared out using ...
5
votes
1answer
156 views

NSolve missing solutions in Mathematica 10

Running Mathematica 8.0.4 and 10.0.0 on a Windows 8.1 machine. Processed the same code with both kernels: ...
5
votes
0answers
215 views

Computing Ehrhart's polynomial for a convex polytope

Is there a Mathematica implementation for computing the Ehrhart polynomial of a convex polytope which is specified either by its vertices or by a set of inequalities? I am interested in knowing this ...
4
votes
3answers
272 views

Finding parameters making real part of eigenvalues vanish

I have the following $\;3\times3$ matrix: $\left( \begin{array}{ccc} 0.04 -0.4 b & 0 & 0.04 -0.4 b \\ 0 & -0.08-1.2 b & -0.06-0.9 b \\ 1.04 -0.4 b & 2.08 -0.8 b & 0 ...