For a regular 17-gon, the formulas above give the x-coordinate of the first vertex in the upper half plane.The first formula goes back to Gauss. The second formula is obtained by a more elementary method, see pages 175 to 180 in this book. This method uses only the trigonometric addition theorem and some clever guesses.
This book is a our through topics from number theory and modern algebra, including the Chinese remainder theorem, quadratic reciprocity and geometric construction of the regular 17, 257 and even the 65 537-gon, Galo is theory, and more. The book contains detailed proofs and many numerical examples with computer code.