Integration of discontinuous expressions arising in beam theory