Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 4 years ago

Max Alekseyev gravatar image

If one just wants to test whether a given polynomial f(x) is positive for all real x, this can be done without representing f(x) as the sum of squares, using the following function:

def is_pol_positive(f):
    return f.leading_coefficient() > 0 and f.number_of_real_roots() == 0