Polynomial regression is essentially a special case of linear regression, where we are using a polynomial as the regression model:

$y = a_1 x + a_2 x_2 + … + a_n x_n + c.$

Note that the raising $x$ to a power is an operation that does not depend on $a_i$ in any way. So what we can do is simply apply the powers to $x$ as a preprocessing step and get $x_i=x_i$, which we then plug into linear regression.

Polynomial regression: an illustration.