This note was inspired by the young friend of a young friend, who claims that *exactly*, and “all the rest is the work of man”.
π=3.14159
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 . The very useful function that measures the height of the pedal as a function of (= distance around) is called .
θ=0
θ
sinθ
GraphicsArrow{-1/2,0},-12,
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}],Magnification2],Inset[θ0,{1.2,0}],Inset[θπ,{-1.2,0}],Dashed,Style[Inset[θ,{.5,1}],Magnification2],Circle[{0,0},1,{2*π/3,π}],AspectRatioAutomatic,PlotRangePadding.1 As your foot goes round and round, keeps increasing, but just goes up and down:
θ
sinθ
Show[Plot[Sin[θ],{θ,0,3}],Plot[Sin[θ],{θ,3,4},FillingAxis],Graphics[{Arrow[{{π+.2,.5},{π+.1,.25}}],Text[Style[π,Magnification2],{π+.25,.625}]}],AspectRatioAutomatic,PlotRangeAll,AxesLabel{θ,Sin[θ]},LabelStyleLarger]
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 the height above the center of the circle. The plot shows sin going negative between 3 and 4, so .
θ=π
π
sinθ=sinπ=0=
θ
3<π<4
But notice something very interesting: is by almost exactly the distance from 3 to . And is by nearly the amount by which 4 exceeds . In other words, if is anywhere near , will be much closer to than was. Try it for the lousy approximation 4:
sin3
>0
π
sin4
<0
π
θ
π
θ+sinθ
π
θ
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 ϵ =plus even smaller terms, where ϵ is how far off we are from π. So θ + sin θ is about π + /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.
digits each time, for as long as we want. The reason this works is that sin θ = sin(π+ϵ) = - sin ϵ =
-ϵ+/6
3
ϵ
3
ϵ
Why should I believe all those digits, now issuing from Mathematica’s sin function?
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:
TrigReduce3-4sin
2
sin
θ
3
θ
3
sin(θ)
If adding the /6 makes no difference at our chosen precision, just use θ for sin θ:
3
θ
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?
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 , 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:
=
-1
NumberQ[I]
True
Simply by forcing =-1to have a solution, all polynomials become solvable. We can even solve , despite the earlier graph clearly confining :
2
x
sinθ=2
-1≤sinθ≤1
sin-log2+
π
2
3
2
(2+
3
)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 and expand:
3sin(θ)-4(θ)
3
sin
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 by actually represents sin θ. Testing a few special cases,
θ
something
θ
Tablesin(θ)-,θ,0,1,π,,,,,
1
2
-θ
1
2
θ
π
2
π
3
π
4
π
5
True,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
It’s being lazy.
Simplify[%]
True,True,True,True,True,True,02-1+
3/10
(-1)
2/5
(-1)
10-2
,True5
Spare the rod and spoil the child.
FullSimplify[%]
{True,True,True,True,True,True,True,True}
CITE THIS NOTEBOOK
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
by Bill Gosper
Wolfram Community, STAFF PICKS, May 10 2023
https://community.wolfram.com/groups/-/m/t/2917779