Formula use:
a^3+b^3=\left(a+b\right)\left(a^2-ab+b^2\right)
a^3-b^3=\left(a-b\right)\left(a^2+ab+b^2\right)
Explanation
Given expression is: {8\left(p-3\right)}^3+343
Factorize
{8\left(p-3\right)}^3+343
\rightarrow\{2\left(p-3\right)\}^3+\left(7\right)^3
\rightarrow\{2\left(p-3\right)+
\left(7\right)\}\left[\{2\left(p-3\right)\}^2-\{2\left(p-3\right)\times7\}+\left(7\right)^2\right]
\rightarrow\left(2p-6+7\right)
\left[4\times\{\left(p\right)^2-2.p.3+\left(3\right)^2\} -\{\left(2p-6\right)\times7\}+49\right]
\rightarrow\left(2p+1\right)\left[\{4\times\left(p^2-6p+9\right)\}-\left(14p-42\right)+49\right]
\rightarrow\left(2p+1\right)\left(4p^2-24p+36-14p+42+49\right)
\therefore\left(2p+1\right)\left(4p^2-38p+127\right)
Ans: \left(2p+1\right)\left(4p^2-38p+127\right)