I am using Python 2 and the fairly simple method given in Wikipedia\'s article \"Cubic function\". This could also be a problem with the cube root function I have to define
Hooked's answer is the way to go if you want to do this numerically. You can also do it symbolically using sympy:
>>> from sympy import roots >>> roots('2*x**3 + 8*x**2 - 8*x - 32') {2: 1, -4: 1, -2: 1}
This gives you the roots and their multiplicity.