The Baldur's gate feat Savage Attacker lets you reroll an attack, and choose the better of the two attacks.
I am attempting to calculate the expected benefit of this feat. Assume, for the sake of simplicity, that a melee attack has a 1d10 damage, which means it follows a discrete uniform distribution with integer values from 1 to 10 (equiprobable). $$A_1\text{ follows Discrete }U(1,10)$$
If we have savage attack, we take two rolls, and then the better of the two. How do I calculate the expected value of the benefit: $$E[|A_1-A_2|] $$
Update 1: I found this video by Stand-Up Math which calculates the actual probabilities (and not just the expected value)

One way is to directly use some CAS and compute $\frac{1}{100}\sum_{x=1}^{10}\sum_{y=1}^{10}|x-y|=3.3$ which will be your expected value i.e. $E(|X-Y|)$ where $X,Y$ are iid uniform discrete variates on $[1,10]$.
The other way is to evaluate this sum by hand.
$$\sum_{x=1}^{10}\sum_{y=1}^{10}|x-y|=\sum_{y=1}^{10}\sum_{x=1}^{y-1}(y-x)+\sum_{y=1}^{10}\sum_{x=y+1}^{10}(x-y)$$
Now both the summands on the RHS are equal by symmetry.
So we focus only on $$\sum_{y=1}^{10}\sum_{x=1}^{y-1}(y-x)$$
Notice that it does not matter if we include the term for $x=y$ as we will be only adding a $0$.
So $$\sum_{y=1}^{10}\sum_{x=1}^{y-1}(y-x)=\sum_{y=1}^{10}\sum_{x=1}^{y}(y-x)=\sum_{y=1}^{10}(y^{2}-\frac{y(y+1)}{2})$$
$$=\sum_{y=1}^{10}(\frac{y^{2}}{2}-\frac{y}{2})=\frac{n(n+1)(2n+1)}{12}-\frac{n(n+1)}{4}$$
where $n=10$ and we are using the formulas $\sum_{k=1}^{n}k=\frac{n(n+1)}{2}$ and $\sum_{k=1}^{n}k^{2}=\frac{n(n+1)(2n+1)}{6}$
If you plug in $10$ in the above expression, you'll get $$\sum_{y=1}^{10}\sum_{x=1}^{y-1}(y-x)=155$$
Hence, by symmtery, $\displaystyle \sum_{y=1}^{10}\sum_{x=1}^{y-1}(y-x)+\sum_{y=1}^{10}\sum_{x=y+1}^{10}(x-y)=155\cdot 2=330$ which agrees with the result derived on a CAS.
So $\displaystyle E(|X-Y|)=\frac{330}{100}=3.3$
In particular, you can use the same reasoning I did above to calculate that $$\sum_{x=1}^{n}\sum_{y=1}^{n}|x-y|=\frac{n(n+1)(2n+1)}{6}-\frac{n(n+1)}{2}$$