How do you mathematically add and subtract hash power?
You sum (add) their individual ratings. For example, if I had two miners, one rated at 20MH/s and another rated at 15MH/s, my total rate would be 20MH/s + 15MH/s = 35MH/s.