
By graphing these functions, I know that P(n) approaches pi as n tends towards infinity. However, is there a mathematical way for proving this?
I am doing a maths exploration on Archimedes' approximation of pi and those are the formulas that I derived for polygons that fit perfectly outside (the first function) and inside (the second function) of a circle with a diameter of 1 (and they work!).
I have also taken the derivative of the functions to show that they are monotone increasing (for the second function) and decreasing (for the first function).

I think that Taylor series could be a simple solution.
Considering that, for small $x$, $$\tan(x)=x+\frac{x^3}{3}+O\left(x^4\right)$$ $$n \tan\big(\frac{\pi}n\big)=n \Big(\frac{\pi }{n}+\frac{\pi ^3}{3 n^3}+\cdots)=\pi+\frac{\pi ^3}{3 n^2}+\cdots$$ For the second (without using the good hint user222031 provided in comments) $$\cos(x)=1-\frac{x^2}{2}+\frac{x^4}{24}+O\left(x^6\right)$$ $$\cos\big(\frac{2\pi}n\big)=1-\frac{2 \pi ^2}{n^2}+\frac{2 \pi ^4}{3 n^4}+\cdots$$ $$\frac 12 -\frac 12 \cos\big(\frac{2\pi}n\big)=\frac{\pi ^2}{n^2}-\frac{\pi ^4}{3 n^4}+\cdots=\frac{\pi ^2}{n^2}\big(1-\frac{\pi ^2}{3n^2}+\cdots\big)$$ $$\sqrt{\frac 12 -\frac 12 \cos\big(\frac{2\pi}n\big)}=\frac{\pi }{n}\sqrt{1-\frac{\pi ^2}{3n^2}+\cdots}=\frac{\pi }{n}\big(1-\frac{\pi ^2}{6n^2}+\cdots\big)$$ $$n\sqrt{\frac 12 -\frac 12 \cos\big(\frac{2\pi}n\big)}=\pi\big(1-\frac{\pi ^2}{6n^2}+\cdots\big)$$
For sure, this be can be done faster using user222031's hint since $$\sqrt{\frac 12 -\frac 12 \cos\big(\frac{2\pi}n\big)}=\sin\big(\frac{\pi}n\big)$$ and since $$\sin(x)=x-\frac{x^3}{6}+O\left(x^4\right)$$ then $$n\sin\big(\frac{\pi}n\big)=n\Big(\frac{\pi }{n}-\frac{\pi ^3}{6 n^3}+\cdots\Big)=\pi\big(1-\frac{\pi ^2}{6n^2}+\cdots\big)$$