To find the volume \( V \) of the rectangular prism, we will use the formula:
\[ V = l \times w \times h \]
Given the dimensions of the rectangular prism:
- Length \( l = 5a \)
- Width \( w = 2a \)
- Height \( h = (a^2 - 3a^2 + a) \)
We first simplify the expression for height \( h \):
\[ h = a^2 - 3a^2 + a = -2a^2 + a \]
Now we can substitute the values of \( l \), \( w \), and \( h \) into the volume formula:
\[ V = (5a) \times (2a) \times (-2a^2 + a) \]
First, calculate \( (5a) \times (2a) \):
\[ (5a) \times (2a) = 10a^2 \]
Now substitute this back into the volume expression:
\[ V = 10a^2 \times (-2a^2 + a) \]
Next, we expand this expression:
\[ V = 10a^2 \times (-2a^2) + 10a^2 \times a \]
Calculating each term gives:
\[ = -20a^4 + 10a^3 \]
Thus, the volume \( V \) of the rectangular prism is:
\[ \boxed{-20a^4 + 10a^3} \]