# The meaning of double slashes and subscripts of a function

I was asked to find a derivative of this function $$f(x)=\frac{1}{2}\|Ax-b\|_2^2+\frac{\gamma}{2}\|x\|_2^2.$$

The problem was I didn't know the meanings of the double vertical slashes $$\|\cdot\|$$ and the top and bottom subscripts 2 at the end of the ||. From my own research, ||v||2 means the norm of vector v in 2 dimensions. But that still didn't help me understand the meaning of the whole function expression above.

$$|\hspace{-1pt}|\cdot|\hspace{-1pt}|$$ simply means the norm. For, $$p\geq1$$, the $$p$$-norm is defined as $$|\hspace{-1pt}|(x_1,\dots,x_n)|\hspace{-1pt}|_p=\sqrt[p]{|x_1|^p+\dots+|x_n|^p}$$. Hence, $$|\hspace{-1pt}|(x_1,\dots,x_n)|\hspace{-1pt}|_p^p$$ simply means $$|x_1|^p+\dots+|x_n|^p$$. In particular, $$p=2$$ referes to the Euclidean norm as $$|\hspace{-1pt}|(x_1,\dots,x_n)|\hspace{-1pt}|_2^2=|x_1|^2+\dots+|x_n|^2$$
The vertical lines represent a norm. The subscript $$2$$ tells us it's the Euclidean norm which is a p-norm. It's basically the length of the vector.
• So ||v|| means the length of vector v? But why did it have 2 subscripts of 2? Would that make it different to having just one subscript of 2? Can you show me how to find the derivative of that function? Thanks
• @Nemo yeah that's exactly how I interpret norms, as a generalization of lengths. It has the subscript $2$ specifically because it's the $2$-norm, which is a $p$-norm so it's the normal Euclidean distance. You'll see the $\vert \vert \cdot \vert \vert_1$ and $\vert \vert \cdot \vert \vert_\infty$ norms often too since they show up in applications. Commented Feb 23, 2023 at 1:40