Integrate term by term:
$$
\int (3x^2 - 2x + 1) \, dx = \int 3x^2 \, dx - \int 2x \, dx + \int 1 \, dx
$$
Apply power rule to each:
$$
\int 3x^2 \, dx = x^3,\quad \int -2x \, dx = -x^2,\quad \int 1 \, dx = x
$$
Combine results and add constant of integration $ C $:
$$
\int (3x^2 - 2x + 1) \, dx = x^3 - x^2 + x + C
$$