could someone please show me, how to solve this system of equations? I am using the summation method. First equation I multiply by $\Sigma x_i$ and second by $-n$ .
Then I get:
$b_0 \cdot \Sigma x_i \cdot n + b_1 \cdot(\Sigma x_i)^2 = \Sigma x_i \cdot \Sigma y_i$
$-b_0 \cdot \Sigma x_i \cdot n - b_1 \cdot \Sigma(x_i)^2 \cdot n = -\Sigma x_iy_i \cdot n$
So I get rid of $b_0$. When i summ together the equations, I get:
$b_1 \cdot (\Sigma x_i)^2 - b_1 \cdot \Sigma(x_i)^2 \cdot n = \Sigma x_i \cdot \Sigma y_i - \Sigma x_i y_i \cdot n$
And the $b_1$ expressed from this equation is: $b_1=\frac{\Sigma x_i \Sigma y_i - \Sigma x_iy_i \cdot n}{(\Sigma x_i)^2 - \Sigma (x_i)^2 \cdot n}$.
But that's wrong. It should be: $b_1=\frac{- \Sigma x_i \Sigma y_i + \Sigma x_iy_i \cdot n}{-(\Sigma x_i)^2 \cdot n + \Sigma (x_i)^2}$.
Where am I wrong? Thanks everyone.
It seems to me you could benefit from a variable change for brevity. Set $n=A$, $\sum x_i=B$, $\sum x_i^2=C$, $\sum y_i=X$ and $\sum x_iy_i=Y$ Your system now becomes $$\begin{align} Ab_0+Bb_1&=X \\ Bb_0+Cb_1&=Y\end{align}$$ Multiply top equation by $B$ and bottom equation by $A$ and subtract the bottom one from the top one to get $$B^2b_1-ACb_1=BX-AY$$ Here solve for $b_1$ $$b_1=\frac {BX-AY}{B^2-AC}=\frac {\sum x_i \sum y_i - n\sum x_i y_i}{(\sum x_i )^2- n\sum x_i^2}$$