$$ L = (\sum^{N}_{i=1}(X_i^2) - 1)^2 $$
$$ \frac{\partial L}{\partial X_i} = \frac{\partial (\sum^{N}_{i=1} (X_i^2) - 1)^2}{\partial X_i} $$
$$ = \frac{\partial (\sum^{N}_{i=1}(X_i^2) - 1)^2 }{\partial (\sum^{N}_{i=1}(X_i^2) - 1)} \frac{\partial (\sum^{N}_{i=1}(X_i^2) - 1)}{\partial X_i} $$
$$ = 2(\sum^{N}_{i=1}(X_i^2) - 1) (2 X_i) $$
$$ = 4X_i( \sum^{N}_{i=1}(X_i^2) - 1 ) $$