This note was inspired by the young friend of a young friend, who claims that
π=3.14159
*exactly*, and “all the rest is the work of man”.
When you pedal your bike, your feet draw circles. Viewed from the right, your right foot goes clockwise. But mathematicians think counterclockwise is positive, and measure angles by how far around your left foot (viewed from the left) has gone, starting from 3 o’clock, which they call
θ=0
. The very useful function that measures the height of the pedal as a function of
θ
(= distance around) is called
sinθ
.
GraphicsArrow{-1/2,0},-12,
3
2,{0,.1},Arrow[BSplineCurve[Table[{Cos[t],Sin[t]},{t,0,2*π/3,π/48}]]],Style[Inset["sin θ",{-.6,.4},Automatic,Automatic,{0,1}],Magnification2],Inset[θ0,{1.2,0}],Inset[θπ,{-1.2,0}],Dashed,Style[Inset[θ,{.5,1}],Magnification2],Circle[{0,0},1,{2*π/3,π}],AspectRatioAutomatic,PlotRangePadding.1
As your foot goes round and round,
θ
keeps increasing, but
sinθ
just goes up and down:
Show[Plot[Sin[θ],{θ,0,3}],Plot[Sin[θ],{θ,3,4},FillingAxis],Graphics[{Arrow[{{π+.2,.5},{π+.1,.25}}],Text[Style[π,Magnification2],{π+.25,.625}]}],AspectRatioAutomatic,PlotRangeAll,AxesLabel{θ,Sin[θ]},LabelStyleLarger]
When your foot reaches 9 o’clock = halfway around, that’s
θ=π
, since
π
(times the length of one pedal crank) is how far your foot traveled (relative to the bike). Here
sinθ=sinπ=0=
the height above the center of the circle. The plot shows sin
θ
going negative between 3 and 4, so
3<π<4
.
But notice something very interesting:
sin3
is
>0
by almost exactly the distance from 3 to
π
. And
sin4
is
<0
by nearly the amount by which 4 exceeds
π
. In other words, if
θ
is anywhere near
π
,
θ+sinθ
will be much closer to
π
than
θ
was. Try it for the lousy approximation 4:
Sin[4.]+4
3.2432
That’s closer. We can do it again and again:
Sin[%]+%
3.14177
Sin[%]+%
3.14159
Sin[%]+%
3.14159
It stopped changing. Does this mean π is exactly 3.14159? No, it means we’re not using accurate enough arithmetic. Let’s go for 50 digits.
SetPrecision[%,50]
3.1415926535897931159979634685441851615905761718750
We told the computer to tack on a bunch of rubbish digits and pretend they are useful.
Sin[%]+%
3.1415926535897932384626433832795028841971693993748
Sin[%]+%
3.141592653589793238462643383279502884197169399375
It stopped changing again! If we want to keep doing this, we can triple the number of
digits each time, for as long as we want. The reason this works is that sin θ = sin(π+ϵ) = - sin ϵ =
-ϵ+
3
ϵ
/6
plus even smaller terms, where ϵ is how far off we are from π. So θ + sin θ is about π +
3
ϵ
/6
, which is way closer than π+ϵ. Another way of saying this is that, near θ = π, sin θ is very nearly the straight line function π - θ. If it were exactly that, θ + sin θ would get π exactly in one step.

Why should I believe all those digits, now issuing from Mathematica’s sin function?

You needn’t. All you need for n digits of sin θ is n digits of θ and sin’s magic triple angle formula:
TrigReduce3-4
2
sin
θ
3
sin
θ
3

sin(θ)
If adding the
3
θ
/6
makes no difference at our chosen precision, just use θ for sin θ:
mySin[θ_]:=θ/;θ(1-θ^2/6)*θ
Otherwise, take sin θ/3 and then triple the angle:
mySin[θ_]:=(3-4*#^2)*#&@mySin[θ/3]
Testing with π/6,
mySin[3.14159/6]//InputForm
0.49999961698725653
mySin[3.141592653589793238/6]
0.500000000000000011
mySin[3.14159265358979323846264/6]
0.50000000000000000000002

Why should I believe the triple angle formula?

There are lots of derivations of
Simplify[3sin(θ)-4
3
sin
(θ)]
sin(3θ)
but they’re middle-schoolish or worse. The non-messy ones involve the artificial number  defined to be the negative of its reciprocal:
1

-
so that 
=
-1
, which won’t win you many friends among calculators. Yet the inclusion of  among numbers has been so enormously profitable that Mathematica does not hesitate:
NumberQ[I]
True
Simply by forcing
2
x
=-1
to have a solution, all polynomials become solvable. We can even solve
sinθ=2
, despite the earlier graph clearly confining
-1≤sinθ≤1
:
sin
π
2
-log2+
3

2
(2+
3
)
+1
2(2+
3
)
Simplify[%]
2
As threatened, the -laced alternate expression for sin is
Sin[θ]==TrigToExp[Sin[θ]]
sin(θ)
1
2

-θ

-
1
2

θ

Strangely, we don’t care what these symbols actually mean—we only need
sin(θ)
1
2

-θ
something
-
θ
something

which we then substitute into
3sin(θ)-4
3
sin
(θ)
and expand:
3*#-4*#^3&[%[[2]]]
1
2

3

-θ
something
-
θ
something

+
3
2

-θ
something
-
θ
something

Expand[%]
1
2

-3θ
something
-
1
2

3θ
something
which can only mean sin 3 θ, QED. But it would be reassuring to see some evidence that replacing
θ
something
by
θ

actually represents sin θ. Testing a few special cases,
Tablesin(θ)
1
2

-θ

-
1
2

θ

,θ,0,1,π,
π
2
,
π
3
,
π
4
,
π
5
,
True,True,True,True,
3
2

1
2

-
1
3
(π)

-
1
2

π
3

,
1
2

1
2

-
1
4
(π)

-
1
2

π
4

,
5
8
-
5
8

1
2

-
1
5
(π)

-
1
2

π
5

,True
It’s being lazy.
Simplify[%]
True,True,True,True,True,True,02
3/10
(-1)

2/5
(-1)
-1+
10-2
5
,True
Spare the rod and spoil the child.
FullSimplify[%]
{True,True,True,True,True,True,True,True}

CITE THIS NOTEBOOK

Computing π with the sin function​
by Bill Gosper​
Wolfram Community, STAFF PICKS, May 10 2023
​https://community.wolfram.com/groups/-/m/t/2917779