Concept:
If a polynomial identity holds for all real \( x \), then the corresponding polynomials must be identical.
We first determine the explicit form of \( f(x) \) by comparing coefficients, and then evaluate the definite integral.
Step 1: Find the polynomial \( f(x) \)
Let:
\[
t=x^2+1 \Rightarrow x^2=t-1
\]
Then:
\[
f(t)=x^4+5x^2+2
\]
Substitute \( x^2=t-1 \):
\[
x^4=(t-1)^2=t^2-2t+1
\]
Hence,
\[
f(t)=(t^2-2t+1)+5(t-1)+2
\]
\[
f(t)=t^2+3t-2
\]
Therefore,
\[
f(x)=x^2+3x-2
\]
Step 2: Evaluate the definite integral
\[
\int_0^3 f(x)\,dx=\int_0^3 (x^2+3x-2)\,dx
\]
\[
=\left[\frac{x^3}{3}+\frac{3x^2}{2}-2x\right]_0^3
\]
\[
=\left(\frac{27}{3}+\frac{27}{2}-6\right)-0
\]
\[
=9+\frac{27}{2}-6=\frac{27}{2}
\]