Why $a^3 - b^3$ is equal to $(a–b) (a^2 + ab + b^2)$, How to calculate it.
if I multiply $(a-b)(a-b)(a-b)$ then I have got $(a-b)(a^2+b^2)$ and it is not the same as above.
Why $a^3 - b^3$ is equal to $(a–b) (a^2 + ab + b^2)$, How to calculate it.
if I multiply $(a-b)(a-b)(a-b)$ then I have got $(a-b)(a^2+b^2)$ and it is not the same as above.
On
You haven't multiplied $(a-b)(a-b)$ correctly; it's $a^2 - 2ab + b^2$, not $a^2+b^2$. You won't get $a^3 - b^3$ at the end either. Try expanding (a-b)(a^2 + ab + b^2), term by term.
On
Yes, you are correct, $(a-b)(a-b)(a-b)$ is not the same as $(a-b)(a^2+ab+b^2)$.
But $(a-b)(a-b)(a-b)$ is also not the same as $a^3-b^3$, so there is no contradiction.
To answer your original question:
$$\begin{align}(a-b)(a^2+ab+b^2)&=a(a^2+ab+b^2)-b(a^2+ab+b^2)\\ &= a^3+a^2b+ab^2-ba^2-bab-b^3 \\&= a^3+(a^2b-ba^2) + (ab^2-bab) -b^3 \\&= a^3+0+0+b^3\\&=a^3-b^3\end{align}$$
P.S. $(a-b)(a-b)(a-b)$ is also not equal to $(a-b)(a^2+b^2)$ as you claim. It is in fact equal to $(a-b)(a^2-2ab+b^2)$.
On
First of all, $(a-b)(a-b)(a-b) = (a-b)^3 \neq a^3-b^3$. This is why your yielding result does not match.
For the derivation of the factorization of $a^3-b^3$, there are many ways to conclude.
To first of all see why it is equal, one may carry out the operations :
$$(a-b)(a^2+ab+b^2) = a^3 + a^2b + ab^2 - a^2b - ab^2 - b^3 = a^3 - b^3$$
Such factorizations can be either formed by knowing inductive formulas and fitting them to your power degree $(n=3$ in our case$)$ or one may assume that $(a-b)$ can be a factor and then try to find a second-degree polynomial such as $(a-b)P(a,b) = a^3-b^3$.
Note : For your edited/updated claim, $(a-b)(a-b)(a-b) \neq (a-b)(a^2+b^2)$, your calculations are mistaken somewhere.
On
$$3^3-2^3=27-8=19$$ and $$(3-2)(3^2+3\cdot2+2^2)=1\cdot(9+6+4)=19.$$
On another hand
$$(3-2)(3-2)(3-2)=1\cdot1\cdot1$$
and
$$(3-2)(3^2+2^2)=1\cdot(9+4)=13.$$
Because \begin{align*} (a-b)(a^2+ab+b^2) &= a(a^2+ab+b^2)-b(a^2+ab+b^2)\\ &=(a^3+a^2b+ab^2)-(a^2b+ab^2+b^3)\\ &=a^3+a^2b+ab^2-a^2b-ab^2-b^3\\ &=a^3-b^3. \end{align*}
That's not quite right. We have: $$(a-b)(a-b)=a(a-b)-b(a-b)=(a^2-ab)-(ab-b^2) = a^2-ab-ab+b^2=a^2-2ab+b^2$$ and so $$(a-b)(a-b)(a-b)=(a-b)(a^2-2ab+b^2).$$
Well $(a-b)(a-b)(a-b) \neq a^3-b^3$, so there's no reason these should be the same. (As an example, take $a=3, b=1$. Then $(a-b)(a-b)(a-b)=2\cdot 2\cdot 2 = 8$, while $a^3-b^3 = 3^3-1^3 = 27-1=26$.)