How can one determine the line of best fit (in the form $y=mx+b$) for a known function, such as $y=x^2$ over the domain $[1,2]$?
Normally I would use a least squares regression with a set of representative points from the function, but this application calls for a more rigorous analysis.
Edit: I'm having difficulties understanding the answers given, so I ended up digging in an old textbook to find the closed form solution of linear regression, then changing the summations to integrals.
Least squares regression guide: https://www.mathsisfun.com/data/least-squares-regression.html
Formulas with data points:
$m=(N*\sum(xy)-\sum(x)\sum(y))/(N*\sum(x^2)-(\sum(x))^2)$
$b=(\sum(y)-m*\sum(x))/N$