Path: Public/pi-day.sagews
Description: Happy pi day 2020
Views: 270
Project: 📚MOOC Studies

# Happy $\pi$ day to all.

Today we also celebrate the life of Stephen Hawking, who passed on 2018-03-14.

%sage
R = RealField(1000)
print("𝜋 to 1000 places")
R(pi)

𝜋 to 1000 places 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127
# the Basel problem
f1 = sum(1/x^2,x,1,oo,hold=True)
f2 = sum(1/x^2,x,1,oo)
show(f1==f2)

$\displaystyle {\sum_{x=1}^{+\infty} \frac{1}{x^{2}}} = \frac{1}{6} \, \pi^{2}$
# Gaussian integral
g1 = integral(e^(-x^2),x,-oo,oo,hold=True)
g2 = integral(e^(-x^2),x,-oo,oo)
show(g1==g2)

$\displaystyle \int_{-\infty}^{+\infty} e^{\left(-x^{2}\right)}\,{d x} = \sqrt{\pi}$
# Euler's identity
h1 = (exp(i*pi,hold=True) + 1)
h2 = (exp(i*pi) + 1)
show(h1==h2)

$\displaystyle e^{\left(i \, \pi\right)} + 1 = 0$