\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)
When the polynomial \(P(x) = x^3 + 2x^2 + ax - 8\) is divided by \(x-3\), the remainder is 10. Find the value of \(a\).
\(a = \)