# Extracting solution points from solving a transcendental equation in Manipulate

I used Manipulate and FindRoot to solve the transcendental equation

x*Tanh[x] == (y + Pi/2)/Tan[y]


where y is varied in steps of .0001 up to 1.57 using Manipulate. I now want extract x values for corresponding y. Can anyone please suggest anything?

• Please include the code in Mathematica format that you are using. – bbgodfrey Jul 14 '17 at 19:00

For many different y's:

FindRoot[x*Tanh[x] == (# + Pi/2)/Tan[#], {x, 1}] & /@ Range[0.1, 1, 0.1]

{{x -> 16.6522}, {x -> 8.73561}, {x -> 6.04784}, {x -> 4.6622}, {x -> 3.79441},
{x -> 3.18395}, {x -> 2.71951}, {x -> 2.34523}, {x -> 2.02959}, {x -> 1.75288}}


replace all the "Range" values with your desired y's...

Have a look at this equation

ContourPlot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, -12, 12}, {y, 0, 1.60},
MaxRecursion -> 5, PlotPoints -> 20] Define FindRoot for both wings of the solution

fr[y_ /; 0 <= y <= Pi/2] := {x /. FindRoot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, 1}],
x /. FindRoot[x*Tanh[x] == (y + Pi/2)/Tan[y], {x, -1}]}

fr[.01]

(*     {158.074, -158.074}     *)