How to find the roots of the Equation

9 Ansichten (letzte 30 Tage)
Twinkle C M
Twinkle C M am 29 Dez. 2019
Kommentiert: Walter Roberson am 31 Dez. 2019
I was trying to find the roots of the equation
tan(x/2)+tanh(x/2)=0.
Can anybody help me in finding the roots.

Akzeptierte Antwort

John D'Errico
John D'Errico am 31 Dez. 2019
This question gets asked so often, that it must be part of a homework or something.
fplot(@(x) tan(x/2)+tanh(x/2),[-10,10])
grid
yline(0);
untitled.jpg
There are infinitely many real roots. You can see three of them in the figure. They will surely not have any simple algebraic form you can write down. There may be complex roots, in fact, that is entirely possible. You could investigate that behavior by plotting things very carefully in the complex plane. How?
Hr = fcontour(@(xr,xi) real(tan((xr + i*xi)/2)+tanh((xr + i*xi)/2)),[-10,10,-10,10]);
Hr.LevelList = 0;
Hr.LineColor = 'b';
hold on
Hi = fcontour(@(xr,xi) imag(tan((xr + i*xi)/2)+tanh((xr + i*xi)/2)),[-10,10,-10,10]);
Hi.LevelList = 0;
Hi.LineColor = 'r';
grid
untitled.jpg
So it appears there are solutions in the complex plane. However, they exist only when x is purely real, OR purely imaginary. Those solutions lie at the intersections of the red and blue curves as I have plotted them. It appears that no solutions exist with simultaneously non-zero real and imaginary parts. With some effort, you could probably prove that claim, but it hardly seems worth the effort.
Actually finding any of the solutions for real or imaginary x will involve nothing more than use of a root finder, suze as fzero or vpasolve. Again, the solution that you find will depend on the start point or the starting interval. Here are three arbitrarily found real solutions.
syms x
vpasolve(tan(x/2)+tanh(x/2),x)
ans =
0
vpasolve(tan(x/2)+tanh(x/2),x,5)
ans =
4.730040744862704026024048100833884819898
vpasolve(tan(x/2)+tanh(x/2),x,12)
ans =
10.99560783800167090666903251910589241754
I seem to recall, from the last time I answered this question, that the roots approach a periodic behavior for large or small x. There will be some multiple of pi involved as I recall. This too can surely be shown, with some effort that may not be worth the effort invested for what is surely a homework assignment.
  1 Kommentar
Walter Roberson
Walter Roberson am 31 Dez. 2019
tanh(x/constant) approaches 1 pretty quickly, so you can form good approximations to it by solving tan(x/2)+1 == 0, which is x/2 = atan(-1) and x = 2*atan(-1) . atan(-1) is -pi/4 + k*pi for integer k, so the solutions approach 2*k*pi - pi/2

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 29 Dez. 2019
Bearbeitet: KALYAN ACHARJYA am 29 Dez. 2019
See solve function here (Must Recomended)
syms x;
fun=tan(x/2)+tanh(x/2)==0
S=solve(fun,x)
  5 Kommentare
Twinkle C M
Twinkle C M am 31 Dez. 2019
How to get complex roots?
Walter Roberson
Walter Roberson am 31 Dez. 2019
Use vpasolve() and give a complex guess.
However, there are an infinite number of real and complex roots, that are approximately (but not exactly) 2*Pi apart from each other.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by