dot-scalarProduct function

Generic method for scalar products, based on integrate