Solving equation for x values

83 Views Asked by At

What methods I can use to solve for $x$? And how to do it?

$$2x + ( 1 + \cot(x/2) ) / \sin(x/2) + 0.8 = 0$$

2

There are 2 best solutions below

1
On BEST ANSWER

You generally want to find the roots of the left hand side of your equation, and since this equation is transcendental and there is no obvious analytic way to go about solving for the roots, you must use iterative numerical methods.

To do this, it generally helps to analyze the characteristics of the equation a little bit before proceeding. Plotting the expression, we get

plot of LHS

We see that there is a single root near $x=0$, and pairs of roots straddling $2\pi+4n\pi$ and $-4n\pi$ for positive integers $n$. Using these facts, you can then implement something like Newton's method with the starting guesses from the above analysis to converge to the proper roots.

0
On

Another way to look at the problem is to plot on the same graph two functions $$f(x)=\left(\cot \left(\frac{x}{2}\right)+1\right) \csc \left(\frac{x}{2}\right)$$ $$g(x)=-2x-0.8$$ and to look where they do intersect. For sure, this will lead to the same analysis as Victor Liu gives in his answer.

For sure, to get the roots, you will need to use numerical methods such as Newton starting from a "reasonable" guess (identified from the graph).

For large values of $x$, as Victor Liu showed, the roots are close to $2\pi+4n\pi$ and we can have pretty good approximations of the solutions using Laurent series. Let us consider the case of $n=0$ and develop the equation around $x=2\pi$. Doing so, and limiting to the very fist terms, we find $$\left(\cot \left(\frac{x}{2}\right)+1\right) \csc \left(\frac{x}{2}\right)+2x+0.8=-\frac{4}{(x-2 \pi )^2}-\frac{2}{x-2 \pi }+\left(\frac{29}{30}+4 \pi \right)+\cdots$$ Solving the quadratic equation then leads to two roots $$x_{\pm}=\frac{60+116 \pi +480 \pi ^2\pm\sqrt{17520+57600 \pi }}{58+240 \pi }$$ which are $5.80841$ and $6.90574$ while the corresponding exact solutions would be $5.79352$ and $6.87779$.

Doing the same for $n=1$, the same procedure would lead to $$\left(\cot \left(\frac{x}{2}\right)+1\right) \csc \left(\frac{x}{2}\right)+2x+0.8=-\frac{4}{(x-6 \pi )^2}-\frac{2}{x-6 \pi }+\left(\frac{29}{30}+12 \pi \right)+\cdots$$ and the roots of the quadratic will be $$x_{\pm}=\frac{60+348 \pi +4320 \pi ^2\pm\sqrt{17520+172800 \pi }}{58+720 \pi }$$ which are $18.5527$ and $19.1981$ while the corresponding exact solutions would be $18.5507$ and $19.1949$ which are cloçser than in the previous case.