is the degree of a polynomial the number of x's or just the highest numbe of x's in a monomial

ex: f(x)=-3x^2(x+2)^3

( a + b ) ^ 3 = a ^ 3 + 3 a ^ 2 b + 3 a b ^ 2 + b ^ 3

( x + 2 ) ^ 3 =

x ^ 3 + 3 x ^ 2 * 2 + 3 x * 2 ^ 2 + 2 ^ 3 =

x ^ 3 + 3 x ^ 2 * 2 + 3 x * 4 + 8 =

x ^ 3 + 6 x ^ 2 + 12 x + 8

- 3 x ^ 2 * ( x ^ 3 + 6 x ^ 2 + 12 x ) =

- 3 x ^ 5 - 18 x ^ 4 - 36 x ^ 3

the degree of a polynomial = 5