How to find the roots of the Equation
9 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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);
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
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
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
2019 年 12 月 29 日
編集済み: KALYAN ACHARJYA
2019 年 12 月 29 日
syms x;
fun=tan(x/2)+tanh(x/2)==0
S=solve(fun,x)
5 件のコメント
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.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!