# Questions tagged [polynomials]

Questions on the functionality operating on polynomials

155 questions
Filter by
Sorted by
Tagged with
16k views

### How do I work with Root objects?

I want to solve the trigonometric equation : $$(3-\cos 4x )\cdot (\sin x - \cos x ) = 2.$$ I tried Solve[(3 - Cos[4*x])*(Sin[x] - Cos[x]) == 2, x] It returns the ...
11k 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 ...
3k 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: ...
3k 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 ...
3k views

### How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
8k views

### First positive root

Simple question but problem with NSolve. I need help how to extract first positive root? For example: ...
14k 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 ...
16k 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 ...
10k 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 ...
1k views

### Why does Expand not work within a function?

I'm writing this fairly simple function: ...
1k views

### How can I reorder the factors in the terms of a polynomial?

How can I reorder the factors in the terms of a polynomial? Consider ...
5k views

### Gram-Schmidt Process for Polynomials

I want to implement the Gram Schimdt procedure to the vector space of polynomials of degree up to 5, i.e. I want to find an orthogonal basis from the set of vectors $v=(1,x,x^2,x^3,x^4,x^5)$. The ...
1k views

### Decomposing a matrix with polynomial elements into a polynomial with matrix coefficients

Let's say I have a matrix, $\mathbf{M}$, that is polynomially dependent on a single variable, such as M = {{15 + a^2, a + 5 a^2}, {a - 5 a^2, 2}} and I want to ...
3k views

### How can we plot the complex roots of an equation?

If we'd like to display the $n$ roots of a polynomial on the complex plane as points, how can we do this? For example, if we have the equation $x^3 + x^2 + x + 1$, how can we plot the 3 roots as ...
1k 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 ...
1k 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... <...
2k 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] ...
605 views

537 views

### Does NRoots own an abstract counterpart? If not, can we write one?

We know when solving linear algebra equations, despite its abstract syntax, LinearSolve is much faster compared to Solve: ...
2k views

### Finding the coefficient of a certain power in a generating function

I want to compute $(t^1+\dots +t^5)(t^2+\dots+ t^6)(t^3+\dots +t^9)$ and find the coefficient of $t^{15}$ for example. $t$ is an indeterminate Now in Maple this is simply as ...
1k views

### How to do the polynomial stuff over finite fields extensions fast?

This question is raised from the problem of package FiniteFields being very slow (please, see the corresponding question): I have had an evidence that Mathematica ...
689 views

### Polynomial expansion of operator

I am new to Mathematica, I am trying to generate the polynomial function of a operator. So for example, the operator $L$ is $\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}$, and I want ...
1k views

### Expressing a polynomial as a sum of squares

I encountered a degree 4 polynomial in 8 variables f(a1,a2,a3,a4,b1,b2,b3,b4) that I suspect can be written as a sum of squares. While sostools in MATLAB would find ...
4k views

### Create a polynomial of a given degree

In Mathematica, how can I create a polynomial function in given variables of a given degree with unknown coefficents? That is, I am looking for a function ...
1k views

### How to get a list of monomials of a polynomial without coefficients?

Giving a polynomial, say a x^2 + b x y + c y^2 MonomialList[a x^2 + b x y + c y^2, {x, y}] just gives ...
918 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, \...
2k 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 ...
1k views

7k views

### The plot of roots of polynomials

I have polynomial equation like Tribonacci Polynomials for example: $T_3(x)=x^4+x$. After finding the roots of this polynomial, I want to show these roots in the complex plane. I have tried lots of ...
776 views

### What are Root objects with multiple polynomials?

In Mathematica 9 a new flavor of Root object with multiple polynomials was introduced. For example, ...
3k 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.
6k 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 ...
7k 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 ...
I can't seem to find a function in Mathematica that factors a polynomial over the reals. Obviously, Factor doesn't work since it works over the integers, over $\mathbb{Z}_p$, or some algebraic fields ...