Solution (source code)

= Solution

First separate the <symmetric tensor> and <antisymmetric tensor> parts:
$$
P_{ij}=\tfrac12(P_{ij}+P_{ji})+\tfrac12(P_{ij}-P_{ji}).
$$
The <trace> of the antisymmetric part vanishes. In three dimensions, remove one third of the trace from the symmetric part, and identify the remaining antisymmetric part with an <axial vector>. The <scalar, symmetric-traceless and axial tensor decomposition> is
$$
\boxed{P=\tfrac13P_{ii},\qquad S_{ij}=\tfrac12(P_{ij}+P_{ji})-\tfrac13P_{kk}\delta_{ij},\qquad A_k=\tfrac12\epsilon_{kij}P_{ij}.}
$$
Here $S_{ji}=S_{ij}$ and $S_{ii}=P_{ii}-P_{kk}=0$. The <contraction of two Levi-Civita symbols> verifies the reconstruction:
$$
\epsilon_{ijk}A_k=\tfrac12\epsilon_{ijk}\epsilon_{k\ell m}P_{\ell m}=\tfrac12(\delta_{i\ell}\delta_{jm}-\delta_{im}\delta_{j\ell})P_{\ell m}=\tfrac12(P_{ij}-P_{ji}).
$$
Therefore
$$
\boxed{P_{ij}=P\delta_{ij}+S_{ij}+\epsilon_{ijk}A_k.}
$$
The pieces contain $1$, $5$ and $3$ independent components respectively, accounting for all nine entries. Taking the trace, then the traceless symmetric part, then the antisymmetric part shows that the decomposition is unique.