Use integration by parts, which undoes the product rule: ∫u dv = uv − ∫v du.
Pick u = x (it gets simpler when differentiated) and dv = eˣ dx (it integrates to itself).
Then du = dx and v = eˣ, so:
∫x eˣ dx = x eˣ − ∫eˣ dx = x eˣ − eˣ + C
Check by differentiating: d/dx (x eˣ − eˣ) = (eˣ + x eˣ) − eˣ = x eˣ. ✓
The same rule works for any polynomial times eˣ: differentiate the polynomial each time it appears, and integrate eˣ as is, until the polynomial vanishes. For example, ∫x² eˣ dx = eˣ(x² − 2x + 2) + C.