Skip to main content
17 votes
Accepted

What is Mathematica's equivalent to Maple's collect with distributed option?

CoefficientRules[eq, {x, y}] /. ({a_, b_} -> c_) :> c x^a y^b // Total Generalize it to a function: ...
xzczd's user avatar
  • 66.8k
11 votes

What is Mathematica's equivalent to Maple's collect with distributed option?

Update 2: An alternative way to define a function that works like Maple's collect using CoefficientRules + FromCoefficientRules: ...
kglr's user avatar
  • 396k
9 votes

What is Mathematica's equivalent to Maple's collect with distributed option?

Another way: ...
Michael E2's user avatar
  • 236k
8 votes
Accepted

What is the smallest degree of polynomial so that its graph includes four extreme points

Use the form InterpolatingPolynomial[{{x1,f[x1],f'[x1]},{x2,f[x2],f'[x2]},...}] We use f[x]==y,f'[x]==0,f''[x]!=0 to verify the ...
cvgmt's user avatar
  • 75k
8 votes
Accepted

How can I compute the $n$-th complete Bell polynomial?

...
Bob Hanlon's user avatar
  • 159k
8 votes

Cannot solve this polynomial equation

...
Bob Hanlon's user avatar
  • 159k
7 votes

What is Mathematica's equivalent to Maple's collect with distributed option?

Another idea is to use a wrapper around the coefficients, and then expanding: ...
Carl Woll's user avatar
  • 131k
7 votes
Accepted

How to make a polynomial so that f(i) = 1/(2^i)?

...
Roman's user avatar
  • 47.9k
7 votes
Accepted

How to get the analytical form of a solution to an algebraic equation?

Using answer in Solving quintic in radicals QuinticToRadicals[sol[[1]]] gives Full code (see post above) ...
Nasser's user avatar
  • 145k
6 votes

Eliminating one variable from two simple polynomial equations

Since you want an implicit equation in x and u... get rid of the denominators ...
Bill's user avatar
  • 12.1k
6 votes

How to get the analytical form of a solution to an algebraic equation?

The simplest approach relies on observation that our polynomial $x^5 + 10 x^3 + 20 x -4$ is of the fifth order with integer coefficients divisible by $2$ (beside one with the highest order power). ...
Artes's user avatar
  • 57.5k
5 votes

How do I extract terms from a complicated polynomial?

...
Syed's user avatar
  • 55.4k
5 votes
Accepted

How do I extract terms from a complicated polynomial?

Try this: Let us introduce the following function: f[expr_, factor1_, factor2_] := Select[Select[expr, MemberQ[#, factor1] &], MemberQ[#, factor2] &]; ...
Alexei Boulbitch's user avatar
5 votes
Accepted

Calculating the basis set of quotient spaces

Here is code for producing a monomial basis set for a polynomial algebra with a finite dimensional vector space. It is taken from the resource function CountPolynomialSolutions with very minor ...
Daniel Lichtblau's user avatar
4 votes

Calculating the basis set of quotient spaces

I do't think @Domen's answer is quite correct. Take, for example, basisSet[(x + y)^3] (* {1, y, x, x y} *) which I don't think is a correct answer: the ...
Roman's user avatar
  • 47.9k
4 votes

How to verify a solution of an ordinary differential equation?

You can't plugin in the implicit solution as is, need to first solve for a[u] from it. This gives 3 solutions. Then verify each one, one by one. Maple can verify ...
Nasser's user avatar
  • 145k
4 votes

How to convert a polynomial into a list?

A variant of E. Chan-López answer pol = p[1, 2, 5] p[3, 6, 9] p[4, 7, 8] - 3 p[1, 2, 4] p[3, 6, 9] p[5, 7, 8]; ...
eldo's user avatar
  • 74.5k
3 votes

How to implement the Vieta's formula in Mathematica in the general case?

I wrote a snippet of Mathematica code for demonstration of Vieta's formula. $$ \sum_{1 \leq i_1<i_2<\cdots<i_k \leq n}\left(\prod_{j=1}^k r_{i_j}\right)=(-1)^k \frac{a_{n-k}}{a_n} $$ ...
138 Aspen's user avatar
  • 1,393
3 votes

Check if polynomial is subtraction free

Perhaps something like: ...
kglr's user avatar
  • 396k
3 votes
Accepted

Check if polynomial is subtraction free

The expressions: t1 = x1x2 (1 + x1x3 - x2); t2 = -x1 (1 + x2 + x2x3); should be bad/good. For this look at the FullForm of t1/t2: ...
Daniel Huber's user avatar
  • 52.6k
3 votes

Relation between coefficients of polynomial to get real roots

Try: Solve[a*x^3 + b*x^2 - x + 2 == 0 && x >= 0, x, Reals] You should get the roots (3) with the conditional domains for the coefficients. The ...
Lexington1776's user avatar
3 votes

What is the smallest degree of polynomial so that its graph includes four extreme points

...
MarcoB's user avatar
  • 67.3k
3 votes

How to rearrange both sides of a polynomial equation?

Since V 12.3 we have SubtractSides and other related functions. f = a x == b y; SubtractSides[f, b y] a x - b y == 0
eldo's user avatar
  • 74.5k
3 votes

How to extract coefficients of polynomial formatted like this?

Subscript[x, 1, 2] + Subscript[a, 2] Subscript[x, 4, 2] // Apply[List] // # /.a_. * Subscript[x, m_?NumericQ, n_?NumericQ ] :> {{m,n},a} & {{{1, 2}, 1}, {{...
AsukaMinato's user avatar
  • 9,928
3 votes
Accepted

How to factorize high-order polynomials that have only complex roots?

As you have the roots, you can get a factorization up to a overall factor of 455 (the coefficient of x^12) by: ...
Daniel Huber's user avatar
  • 52.6k
3 votes

How to convert a polynomial into a list?

pol = p[1, 2, 5] p[3, 6, 9] p[4, 7, 8] - 3 p[1, 2, 4] p[3, 6, 9] p[5, 7, 8]; Using FactorList and the following rules: <...
E. Chan-López's user avatar
3 votes

How to get the analytical form of a solution to an algebraic equation?

Here is a way to do the manipulations in Mathematica/Wolfram Language: ...
ubpdqn's user avatar
  • 61.6k
3 votes
Accepted

How to divide a known root out of a polynomial?

PolynomialQuotient is enough. I just used PolynomialQuotientRemainder to see that remainder is indeed ...
azerbajdzan's user avatar
  • 18.8k
3 votes

How to divide a known root out of a polynomial?

FindInstance returns a rule, not a number. Therefore you need: root = x /. FindInstance[pol == 0, x][[1]] 1/2 (-1 - I Sqrt[3]) To divide the polynomial by the ...
Daniel Huber's user avatar
  • 52.6k
3 votes

How to get the multiplicity of a certain root in a system of polynomial equation

I would expect the multiplicity of (0,0) to be 12. sol = SolveValues[{x^3 == 0, y^4 == 0}, {x, y}] Tally[sol] Regarding comment, this is what I get for the new ...
Nasser's user avatar
  • 145k

Only top scored, non community-wiki answers of a minimum length are eligible