2
$\begingroup$

When we try to solve $\cos x = x$, there is generally no closed form solution but Mathematica has many numerical methods to solve it, for example Why doesn't Mathematica solve $x=\cos\,x$ properly?.

MathWorld shows this as a Dottie Number and you can see more details at What is the solution of cos(x)=x?.

My question, is there any way to get Mathematica to show this as a Dottie Number and it's closed form result?

$\endgroup$
14
  • 2
    $\begingroup$ Some interesting thoughts here: mathematica.stackexchange.com/q/190972/26598 $\endgroup$ Commented Apr 15 at 20:09
  • 2
    $\begingroup$ It gives the exact solution as a Root expression. Reduce[Cos[x] == x, x, Reals] evaluates to x == Root[{-Cos[#1] + #1 & , 0.73908513321516064165715980049797739543` 20.60205998922831}] You get the same solution with Solve. The Root expression is less obscure than Sqrt[1 - (2 InverseBetaRegularized[1/2, 1/2, 3/2] - 1)^2] $\endgroup$ Commented Apr 15 at 20:31
  • 1
    $\begingroup$ @Moo in a sense, what you call a “closed form” is just a particular class of root objects that someone gave a name to. Root objects are a generalization. And Mathematica indeed does convert root objects to named functions whenever it can. $\endgroup$ Commented Apr 16 at 11:40
  • 2
    $\begingroup$ In a perfect world, infinite computing power is available at no cost. AskConstants takes about 30 seconds from $0.739085133215160641655312087674$ to find the closed form RealInverseSphericalBesselY[0, -1, 1] for the Dottie number. Yes, maybe it'd be useful to have automatic processing for such things; but the computational demands may be too high for now. On the other hand – what have we really gained from knowing this specific closed form? Numerical evaluation of RealInverseSphericalBesselY probably still relies on root-finding! $\endgroup$ Commented Apr 16 at 15:43
  • 2
    $\begingroup$ On second thought, the answer RealInverseSphericalBesselY[0, -1, 1] is trivial. It is the AskConstants-internal way of saying InverseFunction[SphericalBesselY[0, #] &][-1], which is the solution of the equation $y_0(z)=-1$. But as $y_0(z)=-\cos(z)/z$, this is obviously the number we are looking for, just using fancy terms like "inverse" and "Bessel" and "spherical". As I said, these fancy words are just a way to describe root objects. $\endgroup$ Commented Apr 16 at 16:08

1 Answer 1

1
$\begingroup$

Well, the exact solution is Sqrt[1 - (2 InverseBetaRegularized[1/2, 1/2, 3/2] - 1)^2]. A long ago I made a bugreport to Wolfram support to add the ability to solve this equation. But I think, they would add it only if it will be one in a class of equations that can be solved with similar methods. Also, this expression is more complicated than Root-based.

$\endgroup$
6
  • $\begingroup$ I don't think this "exact solution" is useful. It says that the Dottie number is $d=\sqrt{1-(2z-1)^2}$ where $z$ satisfies $I_z(\frac12,\frac32)=\frac12$. Putting these together, we find Assuming[d > 0, BetaRegularized[1/2 (1 - Sqrt[1 - d^2]), 1/2, 3/2] == 1/2 // FunctionExpand // FullSimplify] gives $4\sin^{-1}\left(\frac{\sqrt{1-\sqrt{1-d^2}}}{\sqrt{2}}\right)+2d=\pi$. This is an equation for the Dottie number that can be simplified manually to $\cos(d)=d$ and brings no more information or insight than the original Dottie equation. As I said in the comments, it's root-finding with glitter. $\endgroup$ Commented May 19 at 19:51
  • $\begingroup$ @Roman it is a built-in function, that's why it is useful. I think, it is calculated efficiently. $\endgroup$ Commented May 19 at 19:59
  • $\begingroup$ Then why not go for the much simpler InverseFunction[SphericalBesselY[0, #] &][-1]? Or would you only recommend it if Wolfram Inc. implements an InverseSphericalBesselY call that is better optimized than InverseFunction@SphericalBesselY? $\endgroup$ Commented May 19 at 20:26
  • $\begingroup$ @Roman I am sure, InverseFunction operator is higly uneffective, even less so than Root. $\endgroup$ Commented May 19 at 20:36
  • $\begingroup$ @Roman also, if we want an expression suitable for Wolfram Alpha or Excel, we definitely would need a form that uses InverseBetaRegularized. $\endgroup$ Commented May 19 at 20:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.