\[2p(a + 2x) + p(3a - x) =\]
\[= p\left( 2 \cdot (a + 2x) + (3a - x) \right) =\]
\[= p(2a + 4x + 3a - x) =\]
\[= p \cdot (5a + 3x).\]