Where do Mathematicians Get Inspiration for Pi Formulas? 
Question:



*

*Where do people get their inspirations for $\pi$ formulas?

*Where do they begin with these ideas?



Equations such as$$\dfrac 2\pi=1-5\left(\dfrac 12\right)^3+9\left(\dfrac {1\times3}{2\times4}\right)^3-13\left(\dfrac {1\times3\times5}{2\times4\times6}\right)^3+\&\text{c}.\tag{1}$$$$\dfrac {2\sqrt2}{\sqrt{\pi}\Gamma^2\left(\frac 34\right)}=1+9\left(\dfrac 14\right)^4+17\left(\dfrac {1\times5}{4\times8}\right)^4+25\left(\dfrac  {1\times5\times9}{4\times8\times12}\right)^4+\&\text{c}.\tag{2}$$$$\dfrac \pi4=\sum\limits_{k=1}^\infty\dfrac {(-1)^{k+1}}{2k-1}=1-\dfrac 13+\dfrac 15-\&\text{c}.\tag{3}$$
Have always confused me as to where Mathematicians always get their inspirations or ideas for these kinds of identities.
The first one was found by G. Bauer in $1859$ (something I still want to know how to prove. I've found this recently asked question still open for proofs), the second was found by Ramanujan. And has a relation with Hypergeometrical series.
I'm wondering whether people see $\pi$ in other formulas, such as$$\sum\limits_{k=1}^{\infty}\dfrac 1{k^2}=\dfrac {\pi^2}6\implies\pi=\sqrt{\sum\limits_{k=1}^\infty\dfrac 6{k^2}}\tag{4}$$
And isolate $\pi$, or if something new comes up and they investigate it?

For example, I'm wondering if it's possible to manipulate the expansion of $\ln m$
$$\ln m=2\left\{\dfrac {m-1}{m+1}+\dfrac 13\left(\dfrac {m-1}{m+1}\right)^3+\dfrac 15\left(\dfrac {m-1}{m+1}\right)^5+\&\text{c}.\right\}\tag{5}$$
To get a $\pi$ formula. Or the series$$\sum\limits_{k=1}^{\infty}\dfrac 1{k^p}=\dfrac {\pi^p}n\tag{6}$$
Which converges faster and faster as $p$ gets larger and larger.
 A: One method, no doubt, is due to reasoning involving the classic definition of $pi$ (the ratio of the diameter to the circumference). For example the ratio of the diameter of a regular polygon to perimeter as the number of sides goes to infinity gives $\pi$. Starting with the square and doubling the number of sides of the polygon yields the sequence $$2\sqrt2$$ $$4\sqrt{2-\sqrt2}$$ $$8\sqrt{2-\sqrt{2+\sqrt2}}$$
$$16\sqrt{2-\sqrt{2+\sqrt{2+\sqrt2}}}$$ $$\dots$$
You could derive something similar for $\pi^2$ or $\pi^3$ using the areas of regular polygons, surface areas/volumes of convex regular polyhedrons, etc. 
Just speculating: one might get inspiration from physical phenomenon such as angular velocity vs linear velocity for an object traveling in a circle, angular momentum, torque, etc.
A: Many such formulas come from the generalized binomial expansion theorem or geometric series and a bit of interpretation of the definition of $\pi$.  One such example is the Leibniz formula for pi, which comes by noting that
$$\int_0^x\frac1{1+t^2}\ dt=\arctan(x)$$
From here, it follows that
$$\frac\pi4=\arctan(1)=\int_0^x\frac1{1+t^2}\ dt=\int_0^x\sum_{n=0}^\infty(-1)^nt^{2n}\ dt=\sum_{n=0}^\infty\frac{(-1)^n}{2n+1}$$
By applying an Euler transform to this, we get another representation of pi:
$$\frac\pi2=\sum_{n=0}^\infty\frac{n!}{(2n+1)!!}$$
You could take the geometric meaning of pi as area (integral) of a circle to deduce that
$$\frac\pi4=\int_0^1\sqrt{1-x^2}\ dx=\int_0^1\sum_{n=0}^\infty\binom{1/2}n(-1)^nx^{2n}\ dx=\sum_{n=0}^\infty\binom{1/2}n\frac{(-1)^n}{2n+1}$$
You noted that
$$\sum_{k=1}^\infty\frac1{k^2}=\frac{\pi^2}6$$
This is a special case of the Riemann zeta function, which yields another form after an Euler transform:
$$\frac{\pi^2}6=2\sum_{n=0}^\infty\frac1{2^{n+1}}\sum_{k=0}^n\binom nk\frac{(-1)^k}{(k+1)^2}$$
which converges much more rapidly.
Other places pi may show up, relating especially to logarithms:
$$e^{ix}=\cos(x)+i\sin(x)$$
Which is famously known as Euler's formula.
Beyond this, I think the formulas get less and less intuitive and more like a race for the best formula to apply.
A: It's a little of both, really. Often what happens is that they find an equation for something, and see an opportunity to get $\pi$ out of it. My favorite example is the formula $\pi = 4 - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \cdots$. This comes from the Taylor series expansion of $\arctan{x}$, which is $\arctan{x} = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots$. At some point, someone noticed that $\arctan{x}$ often outputs multiples of $\pi$; in particular, $\arctan{1} = \frac{\pi}{4}$. Plugging in $x = 1$ to the Taylor series and then multiplying both sides by $4$ gives the formula.
I don't know of any situation where someone really set out for a formula for $\pi$; it's usually a mathematician working on something else who happens across a new formula. But it's rarely as direct as $\sum_{k=1}^{\infty}\frac{1}{k^2} = \frac{\pi^2}{6}$; it's usually that they have to plug in particular values to make $\pi$ happen.
