https://courses.physics.illinois.edu/phys596/fa2012/Assignments/Assignment_2_FA12.pdf