Raise the power by one, divide by the new power: ∫xⁿ dx = x^(n+1)/(n+1) + C for n ≠ −1. For n = 2 that is x³/3, and differentiating it takes you straight back to x². Every step solver's "integrate" button runs exactly this rule.
The + C is not decoration. d/dx of x³/3 + 7 is still x², so the antiderivative is a whole family of curves, and the definite integral is what you get when you subtract two members of that family — the constant cancels, which is why ∫₀³ x² dx comes out as exactly 9.
Answer
1/3x³ + C
How to read it
The indefinite result carries the constant; the definite version below has none, because it cancels.
Source
Roberval 1635 for x³/3; stated generally by Newton (1665) and Leibniz (1684); standard A-level / IB HL / gaokao
Work it in the calculator
These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.