Finding a Root
In[5]:=
Solve[catenary[50,a] - catenary[0,a] == 10, a]
Solve::tdep: The equations appear to involve transcendental
functions of the variables in an essentially non-algebraic
way.
Out[5]=
50
Solve[-a + a Cosh[--] == 10, a]
a
Mathematica was unable to solve this equation because a appears in a linear term and inside the Cosh[] function. Let's graph the function to get an estimate for the solution.
In[6]:=
f[t_] := catenary[50,t] - catenary[0,t] - 10
In[7]:=
Plot[f[t], {t,20,200}];

It looks like the root is somewhere around 125. One method for improving this estimate is to zoom in on the graph.
Alternatively, Newton's method is an algorithm for approximately finding the root of an equation. We approximate the function with a tangent line and then find the root of the tangent line. (And you thought we would never get around to the subject of this lesson.)
The tangent line to the graph at t = c is
In[8]:=
tangent[t_,c_] := f[c] + (t - c) f'[c]
The graph of the function and its tangent line at t = 125 is
In[9]:=
curvePlot = Plot[f[t], {t,120,130},
PlotStyle -> RGBColor[1,0,0],
DisplayFunction -> Identity];
tangentPlot = Plot[tangent[t,125], {t,120,130},
DisplayFunction -> Identity];
Show[curvePlot, tangentPlot,
DisplayFunction -> $DisplayFunction];

It looks like the tangent line will be a good approximation to the curve. We can easily find the root of a linear function.
In[10]:=
t1 = (Solve[tangent[t,125] == 0, t]//N) [[1,1,2]]
Out[10]=
126.611
We can now construct the tangent line at this point and get an even better estimate of the solution.
In[11]:=
curvePlot = Plot[f[t], {t,126,127},
PlotStyle -> RGBColor[1,0,0],
DisplayFunction -> Identity];
tangentPlot = Plot[tangent[t,t1], {t,126,127},
DisplayFunction -> Identity];
Show[curvePlot, tangentPlot,
DisplayFunction -> $DisplayFunction];

Now we can repeat the procedure using this new tangent line.
In[12]:=
t2 = (Solve[tangent[t,t1] == 0, t]//N) [[1,1,2]]
Out[12]=
126.632
It looks like our solution is about 126.6. Here is a graph of our cable. Setting AspectRatio to Automatic shows the true shape of the cable.
In[13]:=
Plot[catenary[x,t2], {x,-50,50}, AspectRatio -> Automatic];
![]()
Up to An Example: The Length of a Suspended Cable
Exercise 1