#NEWLINE# def _invertx( p , x ) : #NEWLINE# #INDENT# '\n    Returns ``expand_mul(x**degree(p, x)*p.subs(x, 1/x))``\n    ' #NEWLINE# p1 = poly_from_expr ( p , x ) [ 0 ] #NEWLINE# n = degree ( p ) #NEWLINE# a = [ ( c * ( x ** ( n - i ) ) ) for ( ( i , ) , c ) in p1 . terms ( ) ] #NEWLINE# return Add ( * a )