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).\,$
 A: HINT: Substitute $\,f(x) = ax^3 + bx^2 + cx + d$ into your equation and collect coefficients of the different powers of $x$. 
Solve obtained system of linear equations, thus getting an explicit expression for  $f$.
Substitute $\,x = 5\,$ into obtained equation and get the answer.

How do we know that $f$ is the third-order polynomial?    
On the left we have expression involving $\;f\left(x^3\right),\,$ and on the right $\;f^2\left(x\right).\,$
Assuming $\,f\,$ is a polynomial of degree $\,n\in\mathbb R,\,$ we conclude that
$\,3\left(n-1\right) =  2n.\,$
Therefore we conclude that polynomial $\,f\,$ is of order $3$, i.e. 
$\;f(x) = ax^3 + bx^2 + cx + d.\,$

EDIT: Upon request of @AjaySharma I provide explicit solution:
$$
f(x) = a x^3 + b x^2 + c x + d 
\implies 
\begin{cases}
f\left(x^3\right) =  a x^9 + b x^6 + c x^3 + d 
\\
f\left(x^3 - 2\right) =  a \left(x^3-2\right)^3 + b \left(x^3-2\right)^2 + c \left(x^3-2\right) + d 
\end{cases}
$$
Thus the difference 
$$
\begin{aligned}
f\left(x^3\right)-f\left(x^3-2\right) 
& = a \left(\left(x^3\right)^3 - \left(x^3-2\right)^3 \right)
+ b \left( \left(x^3\right)^2 - \left(x^3-2\right)^2 \right) 
+ c \left( \left(x^3\right) - \left(x^3-2\right) \right) 
\\ & =
2a \left(\left(x^3\right)^2 + \left(x^3\right) \left(x^3-2\right)+ \left(x^3-2\right)^2 \right) + 
2b \left( 2x^3-2 \right)  + 2c 
\\ & =
2a \left({x^6} + {x^6} - {2x^3} + {x^6} - {4x^3} + 4 \right) + 
4b \left( x^3-1 \right)  + 2c 
\\ & =
6 a x^6 + \left(4 b - 12 a\right) x^3 + 8 a - 4 b + 2 c
\end{aligned}
$$
On the other hand, 
$$
\begin{aligned}
f^2\left(x\right) & = \left(a x^3 + b x^2 + c x + d \right)^2 = 
\left(a x^3 + b x^2 + c x + d \right)\cdot \left(a x^3 + b x^2 + c x + d \right)
= \\
& = a^2x^6 + \left(2ab\right)x^5 + \left(b^2 + 2ac\right)x^4 + \left(2ad + 2bc\right)x^3 + \left(c^2 + 2bd\right)x^2 + \left(2cd\right)x + d^2
\end{aligned}
$$
Therefore  $\qquad f\left(x^3\right)-f\left(x^3-2\right)  = f^2\left(x\right)+12
\implies $
$$
\begin{aligned}
\implies& 
\ 6 a x^6 + \left(4 b - 12 a\right) x^3 + 8 a - 4 b + 2 c = 
\\ 
=&\ a^2x^6 + \left(2ab\right)x^5 + \left(b^2 + 2ac\right)x^4 + \left(2ad + 2bc\right)x^3 + \left(c^2 + 2bd\right)x^2 + \left(2cd\right)x + d^2 + 12 
\end{aligned}
$$
Let us gather coefficients by powers of $x$:
$$
\begin{aligned}
&x^6:& a^2 &= 6 a &\implies& & a &= 6 \\
&x^5:& 2ab &= 0 &\implies& & b &= 0  \\
&x^4:& b^2+2ac &= 0  &\implies& & c &= 0 \\
&x^3:& 2ad + 2bc &= 4 b - 12 a  &\implies& & d &= -6 \\
&x^2:& c^2 + 2bd &= 0 \\
&x^1:& 2cd &= 0 \\
&x^0:& d^2 + 12 &= 8a - 4b + 2c
\end{aligned}
$$
Thus we get 
$$
\bbox[5pt, border:2.5pt solid #FF0000]{f\left(x\right) = 6x^3-6}
$$
and so $\,f\left(5\right) = 744 .\,$
A: 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 }
$$

