How is experience gained from gym battles calculated? [duplicate]

When people talk about experience gains in Pokemon go, they usually talk about catch bonuses, evolution bonuses, hatching bonuses, etc. I haven't found anything that discusses experience gains from gym battles.

Unlike the bonuses mentioned above, gym battles seem to not reward experience in numbers ending in 0 (or 5 in the case of a Pokemon escaping).

I would assume that the higher the CP of the Pokemon defeated, the more experience would be given, but it looked like I was receiving different amounts for defeating the same Pokemon each time (training a gym). Does anyone know if the experience reward for battling includes other factors like time remaining or HP remaining?


Solution 1:

From my experimentation, you get more experience from using lower-CP Pokemon. So if you have win with a type advantage instead of sheer CP then you get more experience for that.

When I battle the same friendly gym repeatedly to try to join, I find that the experience is not random, but only varies with what I use. So the time and HP seemed to make little difference, since missing a dodge didn't change my experience gain.

I would imagine opposing gyms follow the same patterns, though I haven't gotten a read on how other variables (number of Pokemon used, team composition even if you only use one of them, etc.) affect things.

Solution 2:

Gym experience is doled out based on your "technique" fighting or training that gym, and the level of the opponent(s) you beat. Most people just pick their top CP dude and rush into battle, but you can actually gain more xp by defeating an opponent by using a stronger Poke "type" against that "type" of opponent (i.e. Grass, bug, fairy, rock, blah blah).

If you played the old school Poke cards you'd probably have these match ups memorized, but for most people it requires too much research because you have to quickly assess your opponent "type", and then match it up against the right "type" from your stable.

Ever wonder why when you first attack a gym, the game will default to a lower CP dude? It's not trying to get you to lose, but rather letting you know the best "type" of Poke to use. I don't rely on that though because even if it's the right type, if you don't have enough CP you're going to get crushed.