Yeah, the other answer....didn't really explain it.
So, this is the mathematically scaled formula. Don't worry, I'll explain everything utilizing generation 8 mechanics. First, lets explain what the variables even mean.
a = 1 (that's really it lol)
b = base experience yield, look under base friendship on the right of the DB page
L = The caught or defeated mon's level
s = If the 'mon was battling, 1. Otherwise, if the EXP share was turned on, 2
Lp = The Pokemon that won (dealt the final blow)
t = 1 if you are the Original trainer
1.5 if it is traded domestically
1.7 if it is an international trade
e = If the opposing Pokemon has a lucky egg, then 1.5
Otherwise, 1
p = 1 if there is no power (O-Power, Rotom power, etc.)
0.5 for ↓↓↓, 0.66 for ↓↓, 0.8 for ↓, 1.2 for ↑, 1.5 for ↑↑, or 2 for ↑↑↑, S, or MAX
1.5 boost for Rotom powers
Alright, so we've established this. Lets do a calculation, shall we?
First, lets calculate the abl/5s thing. So, lets imagine we're doing a Hawlucha that battled a Level 69 Chansey (memes are essential). So, A is = 1, obviously, B is 395, s is 1 (it killed the Chansey) and L is 69 (nice). So, now lets do the mafs.
(1 395 69 (nice))/5 = 5451.
Next, lets do the second part: (2L + 10)/(L + Lp + 10) ^ 2.5
L, again, is 69 (nice), and the Hawlucha was also level 69 (nice), making Lp = 69 (nice). That equals 1, because the non-exponential statement has the same dividend and divisor, because they both use 69 (nice) twice, along with a 10.
Now, lets define the final variables.
t is 1.5, as I traded for this Hawlucha from my friend (theoretically, of course)
e is 1.5, as ze Chansey has an e g g
p is for 1, because Rotom hates me so he won't give me a boost. Now, lets do ze final mafs.
(5451 1 + 1) 1.5 * 1.5
I got 12267.
That should be the total experience you get from it. Hope this helps :)
Ze source
Btw, did you know the Chansey had level 69? nice