Write a polynomial function of least degree with rational coefficients so that ​P(x)=0 has the given roots.

x=-4, x=8

To find a polynomial function with rational coefficients that has roots at x = -4 and x = 8, we need to create two linear factors that multiply to zero.

The linear factors can be written as (x - (-4)) and (x - 8). Thus, the polynomial function with rational coefficients is:

P(x) = (x + 4)(x - 8)

After multiplying the two factors together, we get:

P(x) = x^2 - 4x - 32

Therefore, the polynomial function of least degree with rational coefficients and roots at x = -4 and x = 8 is P(x) = x^2 - 4x - 32.