rectangle integral working