Actually, matrix calculus sounds weird too. It is proper called it multivariable calculus. About your doubt is about algebraic manipulation and some derivative rule application. Everything starts with
f(x)=\frac{1}{n}\Sigma_{i=1}^n(x_i-t_i)^2
\frac{\delta}{\delta x}f(x)=\frac{1}{n}\Sigma_{i=1}^n \frac{\delta}{\delta x}(x_i-t_i)^2
applying power and chain rule
\frac{\delta}{\delta x}f(x)=\frac{1}{n}\Sigma_{i=1}^n 2\cdot (x_i-t_i)\frac{\delta}{\delta x_j}(x_i-t_i)
the last term on the right goes to 1 when i=j and 0 everywhere else. So we got
\frac{2}{n}\Sigma_{i=1}^n (x_i-t_i)
hope it helps.