Learning from Integral Losses in Physics Informed Neural Networks