Although this is awesome I still wouldn't call it the most elegant; that would be using complex analysis and an analogy with laplace transforms as in the following video:
https://youtu.be/zil6BXW6yhE
And in case you don't want to start with complex analysis, a laplace transform applied to either Fresnel integral can work too:
https://youtu.be/XxdQxXGtzWw