I use the following facts to derive the commutation relations asked in question:-
- $[X_i,L_j] = i\hbar\ \epsilon_{ijk}X_k$
- $[P_i,L_j] = i\hbar\ \epsilon_{ijk}P_k$
- $[X_i,X_j] = 0 = [P_i,P_j]$
where $\epsilon_{ijk}$ is the Levi-Civita symbol defined as
$\epsilon_{ijk} = \begin{cases}
1& \text{even permutations of (1,2,3)} \\
-1& \text {odd permutations of (1,2,3)} \\
0& \text{any index repeated}
\end{cases}$
- $[A,BC] = B[A,C] +[A,B]C$
- $A_iA_i = A^2$, that is we will implement Einstein's Summation convention.
With these, we get the following:-
$[X^2,L^2] = [X_iX_i,L_jL_j] $
$ = X_iL_j\ [X_i,L_j] + X_i\ [X_i,L_j]\ L_j + L_j\ [X_i,L_j]\ X_i + [X_i,L_j]\ L_jX_i$
$= i\hbar\ (\epsilon_{ijk}X_iL_jX_k + \epsilon_{ijk}X_iX_kL_j + \epsilon_{ijk}L_jX_kX_i + \epsilon_{ijk}X_kL_jX_i)$
The $i$ and $k$ indices in the last term are dummy labels which are summed over. So, interchanging $i \leftrightarrow k$ in the last term, the first and last term above becomes
$i\hbar\ (\epsilon_{ijk}X_iL_jX_k + \epsilon_{kji}X_iL_jX_k) $
$= i\hbar\ (\epsilon_{ijk}X_iL_jX_k - \epsilon_{ijk}X_iL_jX_k) $
$= 0$
For the remaining terms, we use :-
$X_kL_j = i\hbar\ \epsilon_{kjm}X_m + L_jX_k $
With this, the second and third term above becomes
$i\hbar\ (i\hbar\ \epsilon_{ijk}\epsilon_{kjm} X_iX_m + \epsilon_{ijk}X_iL_jX_k +\epsilon_{ijk}X_kL_jX_i - i\hbar\ \epsilon_{ijk}\epsilon_{kjm}X_mX_i)$
The second and third term adds to $0$ just like above, while the first and last term also adds to $0$ because $X_i$ and $X_m$ commute with each other.
This proves $[X^2,L^2] = 0$
One follows exactly the same line of proof as above with $X_i$ replaced by $P_i$ to obtain $[P^2,L^2] = 0$
Cheers!