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