4. (10%) Evaluate the integral \( \int_{-2}^{4} f(x) dx \), where \( f(x) = \left\{ \begin{array}{ll} x^2, & -2 \leq x < 0 \\ x e^x, & 0 \leq x \leq 4. \end{array} \right. \).
4. (10%) Evaluate the integral \( \int_{-2}^{4} f(x) dx \), where \( f(x) = \left\{ \begin{array}{ll} x^2, & -2 \leq x < 0 \\ x e^x, & 0 \leq x \leq 4. \end{array} \right. \).