We don't need a new algorithm. We just transform the data before feeding it to Linear Regression.
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
# 1. Original Data (Just X)
X = [[1], [2], [3]]
# 2. Add Powers (Feature Engineering)
# Degree 2 adds 'x^2' column
poly = PolynomialFeatures(degree=2)
X_poly = poly.fit_transform(X)
print(X_poly)
# Output:
# [[1, 1, 1], <-- 1, x, x^2
# [1, 2, 4],
# [1, 3, 9]]
# 3. Train Standard Linear Regression
model = LinearRegression()
model.fit(X_poly, y)