# why in SVM we have different indices for dot product?

I am confused by Lagrangian method in SVM, I can not understand why we use different indices in dot product.

Suppose with using Lagrangian W is :

$$W_{i}=\sum_{i}L_{i}y_{i}x_{i}$$

In SVM objective function we have

$$min : 0.5 ( W_{i}^{2} )$$

So I think we must have

$$W_{i}^{2} =\sum_{i}L_{i}^{2}y_{i}x_{i}.x_{i}$$

why we have

$$W_{i}^{2} =\sum_{i}L_{i}L_{j}y_{j}y_{i}x_{i}.x_{j}$$

these are very different in the second one we multiply all elements of x together which it does not make sense to me.

This is because dot product is a bi-linear form. suppose you have 2 observation $$x_{1},x_{2}$$ and 3 variables $$w_{1},w_{2},w_{3}$$ then you have

$$w_{1}=L_{1}y_{1}x_{11}+L_{2}y_{2}x_{21}$$

$$w_{2}=L_{1}y_{1}x_{12}+L_{2}y_{2}x_{22}$$

$$w_{3}=L_{1}y_{1}x_{13}+L_{2}y_{2}x_{23}$$

Now in $$W.W$$ we have

$$W.W=w_{1}w_{1}+w_{2}w_{2}+w_{3}w_{3}$$

But notice that

$$w_{1}w_{1}=(L_{1}y_{1}x_{11}+L_{2}y_{2}x_{21}).(L_{1}y_{1}x_{11}+L_{2}y_{2}x_{21})$$