# Points of Intersection of Cosh(x) and Sec(x)

How can I find the points of intersection of cosh(x) and sec(x)?

Plotting the two, I can see that it has a root around 4.7, but then I can't tell where the next root is.

But when I use FindRoot with a guess of 4.7 I don't get the root but if I use a guess between 4.72 and 4.8 then I find the root - 4.730040744862704.

Also, another root - 7.8532046241 can be found by guessing between 7.83 and 7.85.

Q: Is there a better way to solve the equation: Cosh[x]==Sec[x]? Q: How do I see the other points of intersection of the graphs y=Cosh[x] and y=Sec[x]?

Any help would be much appreciated. Thanks!

• FYI FindRoot uses newtons method when you give it a single point and the secant method when you supply 2. The derivative of your function is very large near the root so newtons method shoots off far away from your guess on the first iteration. May 10, 2018 at 15:41
• Q: How do I see the other points of intersection of the graphs y=Cosh[x] and y=Sec[x]? May 14, 2018 at 15:35

You can use Solve or Reduce if you add a domain restriction:

N @ Solve[Cosh[x] == Sec[x] && -10<x<10, x]
N @ Reduce[Cosh[x] == Sec[x] && -10<x<10, x]


{{x -> 0.}, {x -> 0.}, {x -> 0.}, {x -> 0.}, {x -> -7.8532}, {x -> -4.73004}, {x -> 4.73004}, {x -> 7.8532}}

x == -7.8532 || x == -4.73004 || x == 0. || x == 4.73004 || x == 7.8532

(using NSolve directly seems to miss roots)

• Solving N@Solve[Cosh[x]*Cos[x] - 1 == 0 && -10 < x < 10, x] is 20 times faster, presumably because it removes the singularity. May 10, 2018 at 15:13
• Q: How do I see the other points of intersection of the graphs y=Cosh[x] and y=Sec[x]? May 14, 2018 at 15:35
Clear[findRoots]
Options[findRoots] = Options[Reduce];
findRoots[gl_Equal, {x_, von_, bis_},
prec : (_Integer?Positive | MachinePrecision | Infinity) :
MachinePrecision, wrap_: Identity, opts : OptionsPattern[]] :=
Module[{work, glp, vonp,
bisp}, {glp, vonp, bisp} = {gl, von, bis} /.
r_Real :> SetPrecision[r, prec];
work = wrap@Reduce[{glp, vonp <= x <= bisp}, opts];
work = {ToRules[work]};
If[prec === Infinity, work, N[work, prec]]];


A domain restriction is -10 < x < 10

findRoots[Cosh[x] == Sec[x], {x, -10, 10}]

(* {{x -> -7.8532}, {x -> -4.73004}, {x -> 0.}, {x -> 4.73004}, {x -> 7.8532}} *)


Or:

findRoots[Cosh[x]*Cos[x] == 1, {x, -10, 10}](* 33 times faster *)

(* {{x -> -7.8532}, {x -> -4.73004}, {x -> 0.}, {x -> 4.73004}, {x -> 7.8532}}*)