Assuming 6 blocks of confirmation the attack is then:
1. Spend in b2, create blocks until b8.
2. Switch the chain to b2', spend again there and run with it until bX' > bX.
Assuming 6 blocks of confirmation and 51% hash power, you'll lose a lot of money in the process (it'll take ages until bX' > bX [1]) so it better be worth it. Also, you can probably estimate the risk of this happening via the transaction volume in the block. The higher, the more valuable a double spend would be.
[1] Assuming 6 blocks à 10 minutes and you achieving 51%/49% ~ 4% more hashpower, such an attack costs you 25h (150 blocks) so at the very least 150x3.75x51% ~ 286 BTC in opportunity cost plus equipment plus electricity plus the risk that someone switches on his new nodes and your 51% become only 50%.
The cost regarding your equipment will also be full purchase price because if you succeed, you ruin bitcoin and your equipment value becomes 0 with your attack.