I have to multiply the following:
$((x+h)\sqrt{x+h} - x\sqrt{x}) * ((x+h)\sqrt{x+h} + x\sqrt{x})$
I tried to use $(a - b)(a + b) = a^2 + b^2$ so:
$((x+h)\sqrt{x+h} - x\sqrt{x})((x+h)\sqrt{x+h} + x\sqrt{x}) = (x^2 + h^2)(x + h) - x^2(x)$
and then:
$x^3 + x^2h + h^2x + h^3 - x^3 $
and then:
$x^2h + h^2x + h^3$
But the book is showing the answer as $3x^2h + 3xh^2 + h^3$
I don't know where they are getting those $3$'s from. Can someone please tell me what I'm doing wrong?
Notice that $$\begin{align} (x+h)^3 &= x^3 + h^3 + 3xh(x+h) \\ &= x^3 + h^3 + 3x^2h + 3xh^2.\end{align}$$ Therefore, the book's answer is equivalent to $$(x+h)^3 - x^3 = (x+h)^2(x+h) - x^2(x),\tag1$$ but the answer you obtained was $(x^2 + h^2)(x+h) - x^2(x)$, and $x^2 + h^2\neq (x+h)^2$. From this observation, it is clear that you have calculated it incorrectly.
Since $(a+b)(a-b) = a^2 - b^2$ then substitute $a = (x+h)\sqrt{x+h}$ and $b = x\sqrt{x}$. Now, by letting $b = f(x)$, it follows that $a = f(x+h)$, and so if $b^2 = x^2(x)$ then $$a^2 = (x+h)^2(x+h)\neq(x^2+h^2)(x+h),$$ and Eq. $(1)$ is consequently implied.