> Often you'll end up using numerical methods to approximate the solution, but if you can come up with a closed form solution that's much nicer.
Also even with the example in the post , thinking about the problem at first and exploiting it's periodicity before naively integrating numerically over the entire limit affords much faster computation. Although might not be specific to this example , utilising such symmetries can sometimes turn even a numerically intractable problem or a problem that requires days / 100s of gigabytes into something one can do on their laptop in hours.