1

I cannot solve $y = x \cos(x)$ for $x$. I tried expressing $\cos(x)$ as an exponential, but that didn't work.

Does anyone have any advice/direction/commentary or answer?

4 Answers4

2

Not enough reputation for a comment.

Since $\Re e^{ix}=\cos x$, there is left to solve: $$y=x e^{i x}$$ Then we just take the real part of the solution, if this argument is correct.

To solve it we can use the $W$ Lambert function: https://en.wikipedia.org/wiki/Lambert_W_function

1

The equation $$y=x \cos(x)$$ being transcendental, there is no way to get an analyical expression for $x$ and you will need some numerical method. The other problem is that, depending on the value of $y$, the equation has an infinite number of roots.

Focusing on the positive solutions, if $y$ is "small" (which means $y \leq 0.561$), you can use the approximation $$y=x\cos(x) \simeq x\frac{\pi ^2-4x^2}{\pi ^2+x^2}\qquad (-\frac \pi 2 \leq x\leq\frac \pi 2)$$ which leaves you with a cubic equation $$4 x^3+y x^2-\pi ^2 x+\pi ^2 y=0$$ that you can solve using Cardano method (there are thre real roots, the one which is negative to be discarded).

If $y$ is really small, you can use the series expansion $$y=x-\frac{x^3}{2}+\frac{x^5}{24}-\frac{x^7}{720}+O\left(x^9\right)$$ and use series reversion to get $$x=y+\frac{y^3}{2}+\frac{17 y^5}{24}+\frac{961 y^7}{720}+O\left(y^9\right)$$ which will give only the first root.

For all other cases, plot the function, locate more or less where are the roots and use Newton method which, starting with a guess $x_0$, will update it according to $$x_{n+1}=\frac{x_n^2}{x_n-\cot (x_n)}$$

When you consider $y'=0$, the extremum are given by the solution of $x=\tan(x)$ the solutions of which being given by $$x_k=q-q^{-1}-\frac 23q^{-3}-\frac {13}{15}q^{-5}-\frac {146}{105}q^{-7}-\frac {781}{315}q^{-9}-\cdots \qquad \text{where} \qquad q=(2k+1)\frac \pi 2$$ So, you can locate the extrema and approximate the solutions building the second order Taylor series about then. This lets you with almost explicit local approximations of the solutions if you decide to neglect the first derivative.

Edit

Suppose that we look for a root such that, for the equation $x=\tan(x)$, we can neglect all terms beside $q$ and then just make $x_k\simeq q=(2k+1)\frac \pi 2$. Mak a Taylor expansion to second order of $x \cos(x)$ and solve the quadratic. This would give $$x_{2n}=\frac{1}{4} \left((4 n+1)\pi+\sqrt{((4 n+1)\pi)^2-16 y} \right)$$ $$x_{2n+1}=\frac{1}{4} \left((4 n+3)\pi+\sqrt{((4 n+3)\pi)^2-16 y} \right)$$ These seems to be very good approximations.

Please try and report.

0

For $ x=2n\pi, \cos(x)=1 $, so $ x=y=2n\pi $. I doubt if there are other solutions, but I am not sure.

Bach
  • 5,874
  • 2
  • 22
  • 44
0

Basic Lagrange Reversion Attempt:

Here are Lagrange Reversion theorem solutions:

$$x=a+bf(x)\implies x=a+\sum_{n=1}^\infty\frac{b^n}{n!}\frac{d^{n-1}}{da^{n-1}}(f^n(a))$$

we choose $a=0,f(x)=\sec(x)$: $$x=b\sec(x)\iff x\cos(x)\implies\sum_{n=0}^\infty\frac{b^n}{n!}\left.\left(\frac{d^{n-1}}{da^{n-1}}\sec^n(x)\right)\right|_{a=0}$$ with these OEIS coefficients. There should be a simpler formula than the multi sum in the OEIS. Unfortunately, I am unable to find the above derivatives, but a change makes it easier.

Explicit Lagrange Reversion Result:

Here is a solution for the smallest root: $$y\cos(y)=x\implies y=x+\sum_{n=1}^\infty\frac1{n!}\frac{d^{n-1}(x-x\cos(x))^n}{dx^{n-1}}$$ Shown here Now to use the general Leibniz rule and binomial theorem: $$\frac{d^{n-1}(x-x\cos(x))^n}{dx^{n-1}}= (-2)^{-n}\frac{d^{n-1}x^n\left(e^{-\frac{i x}2}-e^\frac{ix}2\right)^{2n}}{dx^{n-1}}=(-2)^{-n}\sum_{k=0}^{n-1}\binom {n-1}k\frac{d^{n-1-k}}{dx^{n-1-k}}x^n \frac{d^k}{dx^k} \left(e^{-\frac{i x}2}-e^\frac{ix}2\right)^{2n}$$ $$\frac{d^k}{dx^k} \left(e^{-\frac{i x}2}-e^\frac{ix}2\right)^{2n}=\sum_{m=0}^{2n}\binom{2n}m (-1)^m \frac{d^k}{dx^k}e^{x i(m-n)}$$

Combining everything together and using a confluent hypergeometric $_1\text F_1(a;b;z)$to Laguerre function derivative identity gives

$$\boxed{y\cos(y)=x\implies y=x+x\sum_{n=1}^\infty\sum_{m=0}^{2n}\frac{(-1)^m e^{i(m-n)x}(2n)!\,_1\text F_1(1-n;2;i(n-m)x)}{(-2)^n(2n-m)!m!}}$$

Shown here in the substitution section. Also, $m$’s upper bound can go up to $\infty$ making both sums interchangeable.

As @Bob Dobbs requested, here is the $x+x \sum\limits_{n=1}^2\sum\limits_{m=0}^{2\cdot2}(\dots)$ expansion:

$$y=\frac x2(2x\sin(x)-x\sin(2x)-6\cos(x)+\cos(2x)+7)+\dots$$

Fourier Series Complicated Attempt:

Additionally, there is a Fourier sine series of a similar branch of the inverse. Hopefully, we can find other branches of the inverse too with these methods.

Тyma Gaidash
  • 13,576