I'm going to teach classes on Physics Laboratory on First year of Bachelor studies. In most of the excercises during data analysis students will have to fit a line to measurements they have taken.
I need formulas that fit data to the model:
$$ y_i = Ax_i + B + \epsilon_i $$
Where $\epsilon_i$ is error for point $i$.
Since in most cases they will have significant errors on both $x_i$ and $y_i$ I need to include: $\sigma_{x_i}$ and $\sigma_{y_i}$). But I have found only formulas that only include errors on $y_i$ by including weights:
$$ w_i=\frac{1}{\sigma_{y_i}^2} $$
I would also like to have formulas for uncertainities on $A$ and $B$ that if needed take into account $\sigma_{x_i}$ and $\sigma_{y_i}$.
Any references to sources that discusses this problems would be also appreciated.
PS. While I would like to be able to use OLS for this --- it is not necessary, model just must be simple enough to be used (and understood) by first year students, and simple enough to be implemented in OOCalc on Excel sheed withhout using advanced stats functions.
PS II. I really checked most obvious sources for that formulas, so please be kind :)