Step 1: Separate the variables.
Rewrite the given equation as:
\[
r \, dx + (x - r^2) \, dr = 0
\]
Separate the variables \( x \) and \( r \):
\[
r \, dx = (r^2 - x) \, dr
\]
Step 2: Integrate both sides.
After solving the integral, we find:
\[
rx = \frac{r^3}{3} + c
\]
Step 3: Conclusion.
Thus, the solution is \( rx = \frac{r^3}{3} + c \), corresponding to option (D).