Statistics · Correlation and regression

Why least squares gives these formulas

The formulas for the least-squares line are not rules to memorize: they fall out of minimizing one function with calculus.