past level 30 cp gain is halved and as level increases, so does power up cost, when you'd be better off powering up pokemon below 30 because it'd be cheaper and you'd get bigger increases.
at level 30 a pokemon is about 90% of the strength of a level 40 pokemon but the cost of powering up that pokemon from 1 to 30 is far less than 90% of the cost it would take to get it from 1 to 40.