what i the difference between the solution of square and the solution of cubes
For squares. see:
https://www.purplemath.com/modules/specfact.htm
For cubes see:
https://www.cliffsnotes.com/study-guides/algebra/algebra-ii/factoring-polynomials/sum-or-difference-of-cubes