Skip to main content
4 of 7
Added explanation
Michael E2
  • 258.7k
  • 21
  • 370
  • 830

If {x0, y0} is a root of a polynomial system {p1, p2} such that there is no other root of the form {x0, y1}, the multiplicity is given by the multiplicity of the zero x0 of the resultant

Resultant[p1, p2, y] 

We can compute the multiplicity of this zero with

SparseArray[ CoefficientList[Resultant[p1, p2, y] /. x -> x0 + u, u] ]["NonzeroPositions"][[1, 1]] - 1 

In the OP's case, the command can be simplified a litte:

SparseArray[ CoefficientList[Resultant[y^4 + 6 x^3*y + x^8, y^2 - x^3, y], x]][ "NonzeroPositions"][[1, 1]] - 1 (* 6 *) 

Comparison

I assume the OP wanted a method, not just the answer. (The OP's is simple enough to do in one's head after all.)

My original method was to use NSolve, which seems to work although the docs do not promise that it will, like this if we add Count as @belisarius did:

Count[NSolve[{p1 == 0, p2 == 0}, {x, y}], {x -> 0.`, y -> 0.`}] 

Generalizing @belisarius's answer, I would get something like

Count[Solve[p1 == 0 /. #, x, Reals] & /@ Solve[p2 == 0, y] // Flatten, x -> 0] 

which indeed yields 6 on the OP's example.

A more difficult example

Now let's consider the system

p = {y^4 + 6 x^3*y + x^8, y^2 - x^3}; 

The solve-based methods give different answers:

Count[NSolve[p == {0, 0}, {x, y}], {x -> 0.`, y -> 0.`}] (* 9 *) Count[Solve[p[[1]] == 0 /. #, x, Reals] & /@ Solve[p[[2]] == 0, y] // Flatten, x -> 0] (* 10 *) 

One solution gets counted twice in the Solve method, I guess, because the Resultant method yields

SparseArray[CoefficientList[Resultant[p[[1]], p[[2]], y], x]][ "NonzeroPositions"][[1, 1]] - 1 (* 9 *) 

Failure all around

If we add some factors to the OP's system so that {x, y} = {0, 1} is a root, all the current solutions fail to yield 6:

p = {(y^4 + 6 x^3*y + x^8) (x^2 + (y - 1)^2), (y - x^3) (y - 1)}; Count[NSolve[p == {0, 0}, {x, y}], {x -> 0.`, y -> 0.`}] (* 3 *) Count[Solve[p[[1]] == 0 /. #, x, Reals] & /@ Solve[p[[2]] == 0, y] // Flatten, x -> 0] (* 8 *) SparseArray[CoefficientList[Resultant[p[[1]], p[[2]], y], x]][ "NonzeroPositions"][[1, 1]] - 1 (* 8 *) 

Orginal answer -- NSolve gives the correct multiplicity in V10

NSolve will return the multiplicity, which turns out to be 6 in this case:

NSolve[{y^4 + 6 x^3*y + x^8 == 0, y - x^3 == 0}, {x, y}, Reals] (* {{x -> 0., y -> 0.}, {x -> 0., y -> 0.}, {x -> 0., y -> 0.}, {x -> 0., y -> 0.}, {x -> 0., y -> 0.}, {x -> 0., y -> 0.}} *) 

Deprecated part of the original answer

And Eliminate works for this system, too, but I wouldn't expect it to work in general:

Eliminate[{y^4 + 6 x^3*y + x^8 == 0, y - x^3 == 0}, y] (* 6 x^6 + x^8 + x^12 == 0 *) 
Michael E2
  • 258.7k
  • 21
  • 370
  • 830