<s>[INST] Find the value of function at $\,x=5$ If $\,f(x)\,$ is a non-constant polynomial of $\,x\,$ such that $\,f\left(x^3\right)-f\left(x^3-2\right)=f^2\left(x\right)+12\,$ is true for all $\,x\,$ then find the value of $\,f\left(5\right).\,$
 [/INST] Given

$$
f(x^3) - f(x^3-2) = f(x)^2 + 12. \tag 1
$$

Let $f(x) = P_n(x)$, where $P_n(x)$ is a polynomial of degree $n$.
LHS is of degree $3(n-1)$ and RHS is of degree $2n$.
Whence

$$
\bbox[16px,border:2px solid #800000] { f(x) = P_3(x) }. \tag 2
$$


We can differentiate $(1)$ and we obtain


$$
\begin{eqnarray}
3 x^2 \Big[ f'(x^3) - f'(x^3-2) \Big] &=& 2 f(x) f'(x)\\\\
3 \Big[ 2 x + 3 x^4 \Big] \Big[ f'(x^3) - f'(x^3-2) \Big]
&=& 2 f(x) f''(x) + 2f'(x)^2\\\\
3 \Big[ 2 + 18 x^3 + 9 x^6 \Big] \Big[ f'(x^3) - f'(x^3-2) \Big]
&=& 2 f(x) f'''(x) + 6 f'(x) f''(x)
\end{eqnarray}
$$

Put in $x=0$ so we get

$$
\begin{eqnarray}
f(0) f'(0) &=& 0\\\\
f(0) f''(0) + f'(0)^2 &=& 0\\\\
f(0) f'''(0) + 3 f'(0) f''(0) &=& 3 \Big[ f'(0) - f'(-2) \Big]
\end{eqnarray}
$$

However, $f'(0) \ne 0$ gives a contradiction,
   as $f(0)=0$ and then $f(0) f''(0) + f'(0)^2=0$.
So

$$
\bbox[16px,border:2px solid #800000] { f'(0) = 0 } \tag 3
$$

If $f(0)=0$ we get $f'(0) = f'(-2) = 0$, which implies that $f(x) = c$ - which is to be excluded.
So

$$
\bbox[16px,border:2px solid #800000] { f(0) \ne 0 } \tag 4
$$

As $f(0) f''(0) + f'(0)^2 = 0$.
So

$$
\bbox[16px,border:2px solid #800000] { f''(0) = 0 } \tag 5
$$

And we also get

$$
f'''(0) = - 3\frac{ f'(-2) }{ f(0) } \tag 6
$$

From $(2)$ $(3)$ $(4)$ and $(5)$ follows that

$$
f(x) = p x^3 + q
\tag 7
$$

From $(7)$ follows

$$
6 p = - \frac{36p}{q}, \quad \Rightarrow \quad q = -6. \tag 8
$$

Put in $x=0$ in $(1)$ and we get

$$
f(0) - f(-2) = f(0)^2 + 12.
$$

Whence

$$
- 6 + 8 p + 6 = 6^2 + 12, \quad \Rightarrow \quad p = 6. \tag 9
$$

So we obtain

$$
\bbox[16px,border:2px solid #800000] { f(x) = 6 x^3 - 6 }
\quad \Rightarrow \quad
\bbox[16px,border:2px solid #800000] {f(5) = 6 \times 5^3 - 6 = 744 }
$$

</s>