Consider a Lagrangian that is invariant under a rotation about the z-axis. We saw in example 5-3 that for a rotation about the z-axis in Cartesian coordinates, we have:
\begin{align}
f_1&=-y\\
f_2&=x\\
f_3&=0\\
g&=0
\tag{5.24}\end{align}
The conserved quantity is thus:
\begin{align}
Q=\sum_{i=1}^np_if_i=-p_xy+p_yx
\tag{5.25}\end{align}
which is the \(z\) component of the angular momentum \(\vec{\ell}=\vec{r}\times\vec{p}\) (we write the angular momentum as \(\vec{\ell}\) here to avoid any confusion with the Lagrangian \(L\)):
\begin{align}
\vec{\ell}=\vec{r}\times\vec{p}
\tag{5.26}\end{align}
In general, the angular momentum in a direction is conserved if the Lagrangian is invariant to rotations about an axis in that direction.