How do we calculate the derivative of $f(x) = x^{3} - 3x$? Let the function :
$$
f(x) =x^{3}-3x
$$ with its domain in the real numbers.
Determine with the help of
$$
f'(x) \equiv \lim _{h\rightarrow 0}\dfrac{f\left( x+h\right) -f\left( x\right) }{h}
$$
the derivative $f'$ of function $f$.
I tried to plug the values of $f$ inside of $f'$:
$$
f (x ) =\lim _{h \to 0}\frac{(x+h)^{3}-3(x+h) -(x^{3}-3x) }{h}
$$
I then tried to factorize but it didn't yeld results.
I don't understand how I can expand $(x + h)^3$ properly.
 A: In this particular case, I think it is more interesting to consider the following equivalent definition:
\begin{align*}
f'(a) & = \lim_{x\to a}\frac{f(x) - f(a)}{x-a}\\\\
& = \lim_{x\to a}\frac{x^{3} - 3x - a^{3} + 3a}{x - a}\\\\
& = \lim_{x\to a}\frac{(x-a)(x^{2} + ax + a^{2}) - 3(x-a)}{x-a}\\\\
& = \lim_{x\to a}\left(x^{2} + ax + a^{2} - 3\right)\\\\
& = 3a^{2} - 3
\end{align*}
where we have made use of the identity:
\begin{align*}
x^{3} - y^{3} = (x-y)(x^{2} + xy + y^{2})
\end{align*}
A: I give you a hint: expand everything, see what cancels, and then divide by $h$ and then take the limit. With that, you should get the required solution.
For your second question regarding expansion, I think it is best to remember the formula for $n\in\mathbb{N}$:
$$(x+h)^n=\displaystyle\sum_{i=0}^n {n\choose i}x^ih^{n-i}$$
A: Look that if you expand your numerator you get:
$$\lim _{h\to  0} \frac{(x+h)^3-3(x+h)-(x^3-3x)}{h}=\lim _{h\to 0}(3x^2+3xh+h^2-3)=3x^2-3$$
Remember that: $(x+h)^3=x^3+3x^2h+3xh^2+h^3$ reading the comment of the user.
