Theory:

1. Consider the standard identity I, \((a+b)^3\)\(=\)\(a^3+3a^2b\)\(+3ab^2+b^3\).
 
a+b3=a3+b3+3a2b+3ab2
 
Take the factor \(3ab\) from the last two terms of RHS.
 
a+b3=a3+b3+3aba+b
 
Keep the required \(a^3+b^3\) in one side and the remaining in other side.
 
a3+b3=a+b33aba+b
 
Taking the common factor \((a+b)\) outside.
 
a3+b3=(a+b)[a+b23ab]
 
a3+b3=(a+b)[a2+2ab+b23ab]
 
a3+b3=(a+b)(a2ab+b2)
 
 
2. Consider the standard identity II, \((a-b)^3\)\(=\)\(a^3-3a^2b\)\(+3ab^2-b^3\).
 
ab3=a3b3+3a2b3ab2
 
Take the factor \(3ab\) from the last two terms of RHS.
 
ab3=a3b3+3abab
 
Keep the required \(a^3-b^3\) in one side and the remaining in other side.
 
a3b3=ab3+3abab
 
Taking the common factor \((a-b)\) outside.
 
a3b3=(ab)[ab2+3ab]
 
a3b3=(ab)[a22ab+b2+3ab]
 
a3b3=(ab)(a2+ab+b2)