Performing mathematical operations on equation