SVM - Kernel Expansion

I have the following statement in a text:

I am not sure how the following expression was expanded to such. Where did the square root 2 come from, and how come we have an i and j iterator in the first term, but not in the second

• try to work with an example, say $x=(x_1,x_2,x_3)$, and $z=(z_1,z_2,z_3)$ Oct 8 '18 at 5:04

Might be easier for you if it was written like that: $$K(x,z) = (x^Tz + c)^2 = x^Tz \cdot z^Tx + 2x^Tz + c^2$$ $$= \sum_{i,j = 1}^n (x_iz_i)(x_jz_j) + \sum_{i=1}^n 2c(x_iz_i) + c^2$$