Sum of residuals in multiple regression equals 0 I understand that in multiple regression 
$$\sum_{}^{} X_{i,j}\hat{u}_{i} = 0 $$
 but I do not understand how my textbook says that if we include the intercept in the regression ($X_{i,0} = 1$)then we get:
$$\sum_{}^{} \hat{u}_{i} = 0$$
Completing the notation with the indices
$$
\forall j: \sum_{i=1}^{n} X_{i,j}\hat{u}_{i} = 0.
$$
As you say, if $X_0$ is the constant then
$$
\forall i: X_{i,0} = 1.
$$
Inputing $j = 0$ into the first equation
$$
\begin{align*}
\sum_{i=1}^{n} X_{i,0}\hat{u}_{i} &amp; = 0 \\
\\
\sum_{i=1}^{n} 1\hat{u}_{i} &amp; = 0 \\
\\
\sum_{i=1}^{n} \hat{u}_{i} &amp; = 0.
\end{align*}
$$