The Total Harmonic Distortion (THD) of a Square Wave is 0.483425847608679. The Total Harmonic Distortion of many standard signals can be computed analytically.
I. V. Blagouchine and E. Moreau, “Analytic Method for the Computation of the Total Harmonic Distortion by the Cauchy Method of Residues” in IEEE Transactions on Communications vol 59, no. 9, pp. 2478-2491 Sept. 2011.
D. Zwillinger, Table of Integrals, Series, and Products, 8th ed. Oxford, UK: Elsevier, 2015, pp. 10-11