A “Closed-Form” Solution to the Geometric Goat Problem​
​Paul Abbott
​abbott@wolfram.com
A recent issue of Quanta Magazine is titled Mathematician Solves Centuries-Old Grazing Goat Problem Exactly. The geometric goat problem—not to be confused with other sites of similar names, such as this one—is described in detail in the paper A Closed-Form Solution to the Geometric Goat Problem [1] by Ingo Ullisch, which gives a “closed-form” solution to this problem.

Closed-Form

Note that I have written “closed-form” as, to quote
Wikipedia
:
In mathematics, a closed-form expression is a mathematical expression expressed using a finite number of standard operations. It may contain constants, variables, certain "well-known" operations (e.g., + − × ÷), and functions (e.g., nth root, exponent, logarithm, trigonometric functions, and inverse hyperbolic functions), but usually no limit, differentiation, or integration.
See also Chow [2] and Borwein and Crandall [3].

Explicit Roots of Transcendental Equations

In Explicit Roots of Transcendental Equations [4], which appeared in my Tricks of the Trade column in The Mathematica Journal (unfortunately, not presently available online), I used a very similar approach to compute explicit roots of transcendental equations.
Cauchy's integral theorem states that if
f(z)
is analytic in some simply connected region
ℛ
, then
∮
γ
f(z)z0
(
1
)
for any closed contour
γ
completely contained in
ℛ
. The roots of a function
g(z)
can be determined by locating the singularities of the reciprocal of the function,
h(z)=1/g(z)
. If
h(z)
has a simple pole at
z
0
, then
f(z)=(z-
z
0
)h(z)
is analytic. Luck and Stevens [5] use this to obtain an explicit expression for the root
z
0
of
g(z)
,
∮
γ
(z-
z
0
)h(z)z0
z
0

∮
γ
zh(z)z
∮
γ
h(z)z
,
(
2
)
where the contour
γ
contains the single pole at
z
0
. We see that the roots are, essentially, the normalized (complex) first
moment
or mean of
h(z)
.

Example: Roots of Bessel Functions

Here we apply this idea to compute roots of the Bessel function.
The roots of
J
0
(z)
lie on the real axis:
In[]:=
Plot[
J
0
(z),{z,0,10}]
Out[]=
2
4
6
8
10
-0.4
-0.2
0.2
0.4
0.6
0.8
1.0

Exact Roots

First note that we can use
Solve
to compute these results directly and (implicitly) exactly:
In[]:=
Solve[{
J
0
(z)0,0<z<10},z]
Out[]=
{{z
j
0,1
},{z
j
0,2
},{z
j
0,3
}}

Complex Roots

In the complex plane, the singularities of the reciprocal of the function are simple poles lying on the real axis:
In[]:=
h(z_):=
1
J
0
(z)
In[]:=
ComplexPlot3D[h(z),{z,-2,10+2},BoxRatios{5,2,1},Mesh10,MeshStyle{White,Gray},PlotPoints25]
Out[]=

Numerical Integration

To determine the first root, we use equation (
2
), integrating around an arbitrary (diamond-shaped) contour enclosing just this root:
In[]:=
/:

0,1
=
NIntegrate[zh(z),{z,1,2-,3,2+,1}]
NIntegrate[h(z),{z,1,2-,3,2+,1}]
//Chop
Out[]=
2.40483
We verify that this value is correct to machine precision:
In[]:=
J
0
(

0,1
)
Out[]=
1.75159×
-16
10

Circular Contour

Alternatively, evaluating both integrals around the same circular contour
z=a+r
θ

z=r
θ

θ,
(
3
)
equation (
3
) becomes
z
0
=a+r
2π
∫
0
f(θ)
2θ

θ
2π
∫
0
f(θ)
θ

θ
,
(
4
)
where
f(θ):=h(a+
θ

r)
. The values of
a
and
r
do not matter as long as the contour circumscribes the root.
To determine the second zero of
J
0
(z)
, we choose a circle centered at
a=5
with radius
r=1
that circumscribes this root and no other.
In[]:=
a=5;r=1;f(θ_):=h(a+r
θ

);
We use equation (
4
) to determine
j
0,2
:
In[]:=
/:

0,2
=a+r
NIntegrate[f(θ)
2θ

,{θ,0,2π}]
NIntegrate[f(θ)
θ

,{θ,0,2π}]
//Chop
Out[]=
5.52008
This is an good approximation to the second root:
In[]:=
J
0
(

0,2
)
Out[]=
1.06129×
-7
10

Fourier Integration

The
th
n
complex Fourier coefficient is defined by
c
n
=
1
2π
2π
∫
0
f(θ)
nθ

θ,
(
5
)
so equation (
5
) reduces to
z
0
=a+r
c
2
c
1
,
(
6
)
involving a simple ratio of Fourier coefficients.
To determine the third zero of
J
0
(z)
, we choose a circle centered at
a=9
with radius
r=1
that circumscribes this root and no other, computing the Fourier coefficients approximately using Fourier, sampling
f(θ)
uniformly over
[0,2π]
just 16 times:
In[]:=
a=9;cs=FourierTablef(θ),θ,0,2π-
π
8
,
π
8
//Rest//Chop
Out[]=
{-14.7356,5.10251,-1.76687,0.611787,-0.211934,0.0731576,-0.0260457,0.00728334,-0.00824435,-0.0100118,-0.042844,-0.0765791,-0.346537,-0.463324,-2.64574}
We use equation (
6
) to determine
j
0,3
:
In[]:=
/:

0,3
=a+r
cs〚2〛
cs〚1〛
Out[]=
8.65373
Then we check that this value is a good approximation to the third root:
In[]:=
J
0
(

0,3
)
Out[]=
-7.16756×
-8
10
Increasing the number of sample points improves the accuracy of roots computed via
Fourier
.

Goat Problem

Ullisch reduces the goat problem to finding the (unique) solution of the transcendental equation
sin(β)-βcos(β)
π
2
,
(
7
)
where
-
π
2
<β<π.
(
8
)
Now, of course, we can compute the unique solution to this transcendental equation exactly as a
Root
object:
In[]:=
goatangle=First@SolveSin[β]-βCos[β]
π
2
,
-π
2
<β<π
Out[]=
β
1.91
…

In[]:=
Sin[β]-βCos[β]
π
2
/.goatangle//FullSimplify
Out[]=
True
Defining
In[]:=
f(β_):=sin(β)-βcos(β)-
π
2
we can immediately compute the numerical value of the solution to any desired precision:
In[]:=
f(β)/.N[goatangle,100]
Out[]=
0.×
-100
10
Alternatively, we can use
Fourier
to solve the transcendental equation (
8
):
In[]:=
a=2;r=1;n=
5
2
;cs=FourierTable1f(a+r
θ

),θ,0,2π-
π
n
,
π
n
//Rest//Chop;
In[]:=
a+r
cs〚2〛
cs〚1〛
//Chop
Out[]=
1.9057

References

[1]
Ingo Ullisch, “A Closed-Form Solution to the Geometric Goat Problem“, 2020
[2]
Timothy Y. Chow, “What is a closed-form number?”, 1999
[3]
Jonathan M. Borwein and Richard E. Crandall, “Closed Forms: What They Are and Why They Matter”, 2013
[4]
Paul C. Abbott, The Mathematica Journal 9(3), 2005
[5]
Rogelio Luck and James W. Stevens, “Explicit Solutions for Transcendental Equations”, 2002