How to find the roots of the Equation

9 ビュー (過去 30 日間)
Twinkle C M
Twinkle C M 2019 年 12 月 29 日
コメント済み: Walter Roberson 2019 年 12 月 31 日
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.

採用された回答

John D'Errico
John D'Errico 2019 年 12 月 31 日
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 件のコメント
Walter Roberson
Walter Roberson 2019 年 12 月 31 日
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

サインインしてコメントする。

その他の回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 29 日
編集済み: KALYAN ACHARJYA 2019 年 12 月 29 日
See solve function here (Must Recomended)
syms x;
fun=tan(x/2)+tanh(x/2)==0
S=solve(fun,x)
  5 件のコメント
Twinkle C M
Twinkle C M 2019 年 12 月 31 日
How to get complex roots?
Walter Roberson
Walter Roberson 2019 年 12 月 31 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by