Boundary integral equation method for electromagnetic and elastic waves