Invertibility of specific function

202 Views Asked by At

This is my first post. I'm not a mathematician, just an electronics engineer who loves mathematics. In one of my projects, I arrived at the following function:

$$V\left(\varphi\right)=\frac{A\sqrt{\pi-\varphi+\sin{\varphi\cos{\varphi}}}}{\sqrt{2\pi}}$$

The project requires $V\left(\varphi\right)$ to be inverted, to obtain angle $\varphi$ (unknown), from a voltage $V$ (known). $V\left(\varphi\right)$ is continuous and strictly monotonic (descending), so an inverse mapping should exist. I tried to invert it symbolically, but couldn't arrive at a closed-form solution for $\varphi\left(V\right)$. By "closed-form solution" I mean a formula that takes me directly (algebraically) from $V$ to $\varphi$. I ended up using MATLAB to compute it numerically, and the project was successfully completed. That was 11 years ago (in 2009).

Recently, that inversion problem resurfaced. Out of pure curiosity, I asked my cousin (a mathematician) to attempt to symbolically invert the above function, but he also couldn't do it, and couldn't even give me an answer as to the existence of such solution. So, my questions are the following:

  1. Does a closed-form expression for $\varphi\left(V\right)$ exist?
  2. If the answer to (1) is YES, can someone provide that function, or point me to a method for deriving it?
  3. If the answer to (1) is NO, what is the formal reason for it? Is there a way to show/prove that such solution does not exist?

This is not a homework question, and the associated practical problem has already been solved numerically. This post was made out of pure curiosity about the invertibility of functions of the form of $V\left(\varphi\right)$. Many thanks to all for your replies.


Adding some graphics, in order to better illustrate the problem.

The following figure shows how the function we're looking for, $\varphi\left(V\right)$, looks like. Notice that there appears to be no symmetry in this function. The values of $\varphi$ lie in the interval $[0,\pi]$, while the values of $V\left(\varphi\right)$ lie in the interval $[0,\frac {A} {\sqrt2}]$.

enter image description here

Based on the comment by @user2661923, the problem can be reduced to the inversion of function $k=x-\sin(x)$. In this case, the values of both $x$ and $k$ lie in the interval $[0,2\pi]$. The following figure shows a plot of the inverse of $k=x-\sin(x)$, together with a plot of the function itself (dashed line). Plotting them both on the same graph is useful, since they both have the same range for their independent and dependent variables. It can be observed that now there is a clear symmetry of this function at the point $(\pi,\pi)$, thanks to the removal of the square root term. This means that we only need to deal with the interval $[0,\pi]$, and use symmetry on that result to obtain the other half ($[\pi,2\pi]$).

enter image description here

5

There are 5 best solutions below

1
On BEST ANSWER

First of all, many thanks to all who replied with answers and comments. I've decided not to mark any of the provided answers as "accepted", since my questions were not really answered, but rather, approximations of the inverse of $V\left(\varphi\right)$ were provided. The answer by @PaulSinclair was, perhaps, the most relevant of all in attempting to answer my questions.

Shortly after posting here, I also posted the same questions to another relevant Stack Exchange community, MathOverflow, where I received the answers I was looking for, albeit not in the clarity I was hoping for (which may actually be impossible, due to the difficulty of the problem). Referring to the answers of my post at MathOverflow, what follows is a summary of the results I obtained.


Question — Does a closed-form expression for $\varphi\left(V\right)$ exist?

Answer — No, it does not exist (but see below).


Question — What is the formal reason for it? Is there a way to show/prove that such solution does not exist?

Answer — As shown in the comment by @user2661923, and by Pietro Majer at MathOverflow, the problem can be reduced to the inversion of function $k=x-\sin(x)$. Rob Corless at MathOverflow notes that this function exactly matches Kepler's Equation, $M=E-e \sin(E)$, where $e=1$. Rob Corless also adds that it is believed that Kepler's equation does not have any closed-form solution (let alone an elementary solution).

Piyush Grover at MathOverflow comments that "Kepler's equation is one of the most studied equations in the history of science. If there was a closed-form solution, it would have been found by now. There are papers about its approximations appearing to this day!"

Furthermore, the MathOverFlow accepted answer by Timothy Chow mentions that the question of whether the inverse of $k=x-\sin(x)$ has a closed-form solution may be answered by investigating if there can exist a solution that lies in a so-called Liouvillian extension of $\mathbb{C}(x)$, the field of rational functions of $x$ with complex coefficients. This includes any function that can be obtained via a finite number of applications of addition, subtraction, multiplication, division, taking $n$th roots, exponentiation, taking logarithms, and since we're working over the complex numbers, trigonometric functions and their inverses are included as well.

Timothy Chow expands further, providing a relevant theorem and several sources that support the above argument, and concludes by providing a source, in which it is mentioned that Liouville himself already knew that the solution to Kepler's equation (i.e., the solution to our problem) is not Liouvillian (i.e., there is no closed-form solution, as defined above).

Although I have not yet managed to fully decipher all the results provided, probably due to my lack of experience and knowledge in such advanced topics of mathematics—I'm not a mathematician, but an electronics engineer—I believe we now have sufficiently strong evidence to support the answer to my first question above, i.e., that there is no closed-form expression for $\varphi\left(V\right)$.


Approximations of the inverse of $k=x-\sin(x)$, and of $\varphi\left(V\right)$.

Among the answers I received here in Mathematics Stack Exchange, of particular interest and practical significance are those of @ClaudeLeibovici, who computed approximations of the inverse of $k=x-\sin(x)$ using a variety of methods, as listed below:

  1. Taylor expansion approximation (at various points in $[0,\pi]$),
  2. Rational approximation,
  3. Padé approximation (using the Householder and Halley methods).

You can refer to his specific answers for more details on each approach. I have evaluated all of his methods, and have found them to be of good to excellent accuracy, and extremely useful in practical applications, as they effectively provide closed-forms for very accurate approximations of $\varphi\left(V\right)$, enabling it to be evaluated in real-time by an embedded, microcontroller-based system, for example.

The figure below shows the errors of each approximation, for the reduced problem of inverting $k=x-\sin(x)$ (top plots), and for the complete solution to the practical problem, i.e., the computation of $\varphi\left(V\right)$ (bottom plots). Please refer to the comments I've made to each of Claude's answers, for some finer points regarding the implementation of each method.

enter image description here

1
On

First of all, most algebraic expressions do not have nice closed-form inverses. Even polynomials of degree 5 or greater will generally not have one, except by use of really esoteric functions that are no easier to calculate than those numeric methods you've mentioned.

In this case, you would be fine except for that mixture of $\phi$ inside and outside of the trigonometric functions. As user2661923 points out, this part can be simplified to $\sin\alpha - \alpha$, but that has no nice inverse. Mind you, You can define a function to give that inverse, but this is (mostly) just linguistic shuffling, not actual solving.

Just say "Define $w(y)$ to be the angle $\alpha$ for which $\sin \alpha - \alpha = y$". Now you can solve your equation thusly:

$$\phi = \frac 12w\left(\frac {2\pi V^2}{A^2} - \pi\right)$$

Looks nicer, but from a standpoint of calculation, you are not really any closer. If you are just looking for a few values, a judicious use of Newton's method will find them faster.

However, if you have need to make this calculation repeatedly, then it makes sense to find enough terms of the Taylor series of $w$ to get the accuracy you need. The inverse of $w$, that is $\sin \alpha - \alpha$ has a well-known Taylor series, and there are techniques for inverting power series. Or you can use implicit differentiation to find derivatives of $w$ and build the Taylor series that way.

6
On

Using @user2661923's comments, we end with $$k=x-\sin(x)$$

The first thing we could do is a Taylor expansion around $x=0$ ( to get $$k=\frac{x^3}{6}-\frac{x^5}{120}+\frac{x^7}{5040}-\frac{x^9}{362880}+\frac{x^{11}}{39 916800}-\frac{x^{13}}{6227020800}+O\left(x^{15}\right)$$ which is very accurate.

Then a series reversion leads to
$$x=t+\frac{t^3}{60}+\frac{t^5}{1400}+\frac{t^7}{25200}+\frac{43 t^9}{17248000}+O\left(t^{11}\right)$$ where $t=\sqrt[3]{6k}$.

Edit

Doing the same around $x=\frac \pi 2$ , we should get $$x=\frac{\pi }{2}+t-\frac{t^2}{2}+\frac{t^3}{2}-\frac{7 t^4}{12}+\frac{3 t^5}{4}-\frac{46 t^6}{45}+\frac{29 t^7}{20}-\frac{21341 t^8}{10080}+O\left(t^{9}\right)$$ where $t=k+1-\frac \pi 2$.

Doing the same around $x=\pi $ , we should get $$x=\pi +t+\frac{t^3}{12}+\frac{t^5}{60}+\frac{43 t^7}{10080}+\frac{223 t^9}{181440}+\frac{60623 t^{11}}{159667200}+\frac{764783 t^{13}}{6227020800}+O\left(t^{15}\right)$$ where $t=\frac{k-\pi}2$.

11
On

I prefer to add a second answer.

If series reversions are not sufficiently good, the only practical posibility I can see is to express $\big[x-\sin(x)\big]$ as a rational function easy to inverse. So, the idea was to try to reduce the problem to a quadratic equation in some power of $x$.

From that, the idea of using $$f(x)=x-\sin(x) \sim \frac {x^n(a+b x^n)}{1+cx^n+d x^{2n}}=g_n(x)$$ Matching the function and first derivative values at $x=0,\frac \pi 2,\pi$,was computed $$\Phi_k=\int_0^\pi \Big[f(x)-g_n(x)\Big]^2\,dx$$ What was obtained is $$\Phi_1=2.33\times 10^{-4} \qquad \Phi_2=7.33\times 10^{-5} \qquad \Phi_3=1.25\times 10^{-6}$$ So, $k=3$ was retained (it leads to a maximum error of $0.0015$). Notice that this choice is also dictated by the fact that, plotted as function of $x$, $\big[x-\sin(x)\big]^{\frac 13}$ is very close to linearity.

Then, the problem is just a quadratic equation in $x^3$ $$ (b-d k)x^6+ (a-c k)x^3-k=0$$

$$x=\left(\frac{\sqrt{(a-c k)^2+4 k (b-d k)}-(a-c k)}{2 (b-d k)}\right)^{\frac 13}$$

The parameters are

$$a=\frac{819 \pi ^2-4704 \pi+6720}{2\pi^ 2(31 \pi^2 -72\pi-72) }\qquad \qquad b=-\frac{42 (\pi^2-56\pi+ 164)}{\pi ^5 (31 \pi^2 -72\pi-72)}$$ $$c=\frac{3 (395 \pi^2 -1472\pi+768)}{2 \pi ^3 (31 \pi^2 -72\pi-72)}\qquad \qquad d=-\frac{8 (32 \pi^2 -285\pi+576)}{\pi ^6 (31 \pi^2 -72\pi-72)}$$

Below are reported some results

$$\left( \begin{array}{ccc} k & \text{estimate} & \text{solution} \\ 0.0 & 0.00000 & 0.00000 \\ 0.1 & 0.85428 & 0.85375 \\ 0.2 & 1.08378 & 1.08369 \\ 0.3 & 1.24849 & 1.24852 \\ 0.4 & 1.38226 & 1.38228 \\ 0.5 & 1.49729 & 1.49730 \\ 0.6 & 1.59958 & 1.59959 \\ 0.7 & 1.69257 & 1.69259 \\ 0.8 & 1.77844 & 1.77851 \\ 0.9 & 1.85867 & 1.85881 \\ 1.0 & 1.93434 & 1.93456 \\ 1.1 & 2.00623 & 2.00655 \\ 1.2 & 2.07496 & 2.07538 \\ 1.3 & 2.14100 & 2.14151 \\ 1.4 & 2.20474 & 2.20534 \\ 1.5 & 2.26650 & 2.26717 \\ 1.6 & 2.32653 & 2.32726 \\ 1.7 & 2.38505 & 2.38584 \\ 1.8 & 2.44227 & 2.44308 \\ 1.9 & 2.49833 & 2.49915 \\ 2.0 & 2.55339 & 2.55420 \\ 2.1 & 2.60757 & 2.60834 \\ 2.2 & 2.66097 & 2.66169 \\ 2.3 & 2.71370 & 2.71436 \\ 2.4 & 2.76585 & 2.76643 \\ 2.5 & 2.81751 & 2.81799 \\ 2.6 & 2.86873 & 2.86912 \\ 2.7 & 2.91961 & 2.91989 \\ 2.8 & 2.97019 & 2.97038 \\ 2.9 & 3.02054 & 3.02065 \\ 3.0 & 3.07073 & 3.07077 \\ 3.1 & 3.12079 & 3.12080 \end{array} \right)$$

Using as a basis this model, a nonlinear regression gives the following results $(R^2 > 0.9999999)$ $$\begin{array}{clclclclc} \text{} & \text{Estimate} & \text{Standard Error} & \text{Confidence Interval} \\ a & 0.164158286954 & 0.000056596 & \{0.164045944,0.164270630\} \\ b & 0.033111490794 & 0.000405629 & \{0.032306324,0.033916658\} \\ c & 0.241175528209 & 0.002683157 & \{0.235849503,0.246501553\} \\ d & 0.003405195311 & 0.000043215 & \{0.003319414,0.003490977\} \\ \end{array}$$

Making them rational $$a=\frac{5061}{30830} \qquad b=\frac{403}{12171}\qquad c=\frac{1551}{6431}\qquad d=\frac{148}{43463}$$ which are quite close to the theoretical values given above (but they better distribute the errors, the maximum of them being $0.0002$).

4
On

Another solution

Built around $x=0$ the simplest Padé approximant is $$x-\sin(x) \sim \frac {x^3}{6+\frac{3 }{10}x^2}$$ for the zero of function $$f(x)=x-\sin(x)-k$$ we can generate the starting point $$t=\frac{k}{10} \left(1+2 \cosh \left(\frac{1}{3} \cosh ^{-1}\left(1+\frac{3000}{k^2}\right)\right)\right)$$

Using the first iteration of the original Householder method would give $$x\sim t+\frac{3 \left(\left(4 (k-t)^2+13\right) \sin (t)+16 (t-k) \cos (t)+16 k-16 t-8 \sin (2 t)+\sin (3 t)\right)}{72-8 (k-t) (\sin (2 t)-3 \sin (t))+\left(4 (k-t)^2-95\right) \cos (t)+24 \cos (2 t)-\cos (3 t)}$$ which seems to be much better than the previous ones (for seven significant figures the results are identical).

$$\left( \begin{array}{ccc} k & \text{estimate} & \text{solution} \\ 0.1 & 0.853750157 & 0.853750157 \\ 0.2 & 1.083691880 & 1.083691880 \\ 0.3 & 1.248515468 & 1.248515468 \\ 0.4 & 1.382284134 & 1.382284134 \\ 0.5 & 1.497300389 & 1.497300389 \\ 0.6 & 1.599585617 & 1.599585617 \\ 0.7 & 1.692592064 & 1.692592064 \\ 0.8 & 1.778505826 & 1.778505826 \\ 0.9 & 1.858809984 & 1.858809984 \\ 1.0 & 1.934563212 & 1.934563212 \\ 1.1 & 2.006551534 & 2.006551534 \\ 1.2 & 2.075377185 & 2.075377185 \\ 1.3 & 2.141513666 & 2.141513662 \\ 1.4 & 2.205341448 & 2.205341441 \\ 1.5 & 2.267172019 & 2.267172009 \\ 1.6 & 2.327264597 & 2.327264581 \\ 1.7 & 2.385838062 & 2.385838038 \\ 1.8 & 2.443079689 & 2.443079654 \\ 1.9 & 2.499151659 & 2.499151610 \\ 2.0 & 2.554196019 & 2.554195953 \\ 2.1 & 2.608338518 & 2.608338428 \\ 2.2 & 2.661691618 & 2.661691498 \\ 2.3 & 2.714356902 & 2.714356747 \\ 2.4 & 2.766427025 & 2.766426827 \\ 2.5 & 2.817987310 & 2.817987063 \\ 2.6 & 2.869117087 & 2.869116786 \\ 2.7 & 2.919890822 & 2.919890466 \\ 2.8 & 2.970379096 & 2.970378689 \\ 2.9 & 3.020649454 & 3.020649011 \\ 3.0 & 3.070767176 & 3.070766727 \\ 3.1 & 3.120795977 & 3.120795577 \end{array} \right)$$

A simpler could be given using instead the first iteration of the original Halley method $$x \sim t+\frac{4 \sin ^2\left(\frac{t}{2}\right) (k-t+\sin (t))}{(k-t) \sin (t)+(\cos (t)-4) \cos (t)+3}$$