Step 1: Integrate:
\[ \int_0^a (x^2 - 4x + 1)dx = \frac{a^3}{3} - 2a^2 + a \]
Step 2: Solve:
Set it equal to \(6\) and multiply by \(3\): \(a^3 - 6a^2 + 3a - 18 = 0\).
Group: \(a^2(a-6) + 3(a-6) = (a-6)(a^2+3) = 0\).
\(a^2 + 3 = 0\) has no real root, so the only real value is \(a = 6\).
Step 3: Check:
At \(a=6\): \(\frac{216}{3} - 72 + 6 = 72 - 72 + 6 = 6\). It works.
Final Answer:
The real value is \(a = 6\), option (B).
\[ \boxed{6} \]