The given inequality is \( \int_0^a x \, dx \leq a + 4 \).
First, solve the integral:
\[
\int_0^a x \, dx = \frac{a^2}{2}
\]
Now, substitute this into the inequality:
\[
\frac{a^2}{2} \leq a + 4
\]
Multiply through by 2 to eliminate the fraction:
\[
a^2 \leq 2a + 8
\]
Rearrange the terms:
\[
a^2 - 2a - 8 \leq 0
\]
Factorize the quadratic equation:
\[
(a - 4)(a + 2) \leq 0
\]
This inequality holds for \( -2 \leq a \leq 4 \). Thus, the solution is \( -2 \leq a \leq 4 \).