4

I have encountered this equation:

$$x^y = ax-b$$

I know to find $y$ as a function of $x$ then:

$$y\ln(x) = \ln(ax-b)$$

$$y = \frac{\ln(ax-b)}{\ln(x)}$$

or

$$y = \log_x(ax-b)$$

But the problem I need to find $x$ as a function of $y$ and don't know how .

IV_
  • 7,902
  • Source of the problem? – Shimura Variety Jun 02 '22 at 09:30
  • Also, x should be greater than 0 so that $x^y$ is well defined right? – Shimura Variety Jun 02 '22 at 09:33
  • There is no elementary solution, but it can be solved via the Lambert W function and can also be expressed as a series via the Lagrange inversion theorem. See here. – KStar Jun 02 '22 at 10:45
  • @KStarGamer: Lambert $W$ will not help because there is no $x$ in the exponent. Similar to why $W$ is useless when solving quintic equations in the case $y=5$. – emacs drives me nuts Jun 02 '22 at 12:31
  • @emacsdrivesmenuts ah indeed my mistake. The series solution I mentioned is valid however. – KStar Jun 02 '22 at 13:16
  • @KStarGamer: That series only works for integral $y$, or is it generic and also wors for, say $y=\pi$? – emacs drives me nuts Jun 02 '22 at 13:25
  • 1
    @Devansh Bhardwaj , the equation is composited by me to solve a problem , y is the number of terms at a geometric sequence , x is the factor , this equation meant to find x using y at any given geometric sequence sum , Ex if the geometric sequence sum is 1000 , the equation will be x^y = 1000x-999 , at sequence sum 10 x^y = 10x-9 , my practical example was that I have programmed a DCA Martingale bot simulator at excel , y is the number of safety orders , x is the volume scaling , the seq. Sum is the number of shares , I thought there is a simple solution but I was so wrong :D – thelordabdo Jun 02 '22 at 20:39
  • 1
    To be specific this equation is not a part of the simulation itself , but This equation was meant to help me fast limiting the number of assumptions before running the monte Carlo simulation . – thelordabdo Jun 02 '22 at 20:43
  • Are you still interested on the analytical solution? – ZKZ Jun 04 '24 at 23:44

3 Answers3

5

If $y\in \Bbb N$, then the problem is finding roots of a polynomial of degree $y$. This problem has general closed-form representations of roots only for $y\in\{1,2,3,4\}$, for example solutions for linear, quadratic, cubic and quartic equations for the cases 1, 2, 3 and 4, respectively.

Apart from that, there are only few cases that can be reduced to the solutions above:

  • $y\in\{-1,-2,-3\}$: Multiply the equation with $x^{-y}$ will result in solving a polynomial equation of degree $y+1$. Notice that $x=0$ needs special treatment.

  • $y\in\{\frac12,\frac13,\frac14\}$: Substituting $x=z^{1/y}$ will yield a polynomial of degree $1/y$ in $z$.

  • $y\in\{-\frac12,-\frac13\}$: Substituting $x=z^{-1/y}$ will get us to a polynomial of degree $1-1/y\in{3,4}$.


Approximating Solutions

Apart from that, there are numerical methods like Newton-Raphson iteration that converge very quickly (quadratically) in the general case:

Approximating zeros of $f(x) = x^y-ax+b=0$ by picking some initial value and then iterating

$$x\mapsto x-\frac{f(x)}{f'(x)} = x-\frac{x^y-ax+b}{yx^{y-1}-a} = \frac{(y-1)x^y-b}{yx^{y-1}-a} $$


How solutions change with (small) changes in $y$

The closest you can get to finding $x$ as a function of $y$, is using the implicit function theorem around a solution of the equation. So let $g(x,y) = x^y-ax+b = 0$ then the total differential is

$$(yx^{y-1}-a)dx + x^y\ln x \,dy = 0$$

so that

$$\frac{dx}{dy} = \frac{x^y\ln x}{a-yx^{y-1}}=:h(x,y)$$

This means that if you found a solution $g(x_0,y_0) = 0$, and you change $y$ a little bit to $y_0+\Delta y$, then the adjusted solution for $x_0$ is around

$$x_0+\Delta x \approx x_0 + \Delta y\frac{x_0^{y_0}\ln x_0}{a-y_0x_0^{y_0-1}} =\Delta y\cdot h(x_0,y_0) $$

This is only a hint for $x>0$ (so that we can take $\ln x$) and where the denominator of $h$ is not zero.


Example

Say we have $a=2$ and $b=-4$, then $(x,y) = (2,3)$ is a solution to $g(x,y)=0$. We want to estimate $x$ when we change $y$ slighly to $y+\Delta y=3.01$. The estimate above tells us we have to expect $x+\Delta x\approx 1.9944548$ whereas the actual solution is around $1.9944853$.

  • Thank you so so much for your effort and time , its so helpful and informative , I didn't think that solving this equation is so hard like that , as this equation is composited by me not from a textbook ,I was trying to solve a problem while making a simulation that I need at excel , I thought solving this equation without solver will help me alot , I didn't know its so complicated and indirect like that , thank you again . – thelordabdo Jun 02 '22 at 20:05
2

Here are $2$ solutions using Wolfram Alpha with a similar derivation to this solution. The function used is Inverse Beta Regularized $\text I^{-1}_s(a,b)$ which is usually a quantile function. To use it, one must have $0\le s\le 1;a,b>0$:

$$x^y-ax+b=0\implies x=\frac{by\,\text I^{-1}_{-\frac{b^{y-1}(1-y)^{1-y}y^y}{(-a)^y}}(-y,2)}{a(y-1)},y<0,0\le -\frac{b^{y-1}(1-y)^{1-y}y^y}{(-a)^y} \le 1$$

Test the left formula here

and

$$x^y-ax+b=0\implies x=\frac{by}{a(y-1)\text I^{-1}_\frac{b^{y-1}(y-1)}{(-a)^y\left(\frac1y-1\right)^y}(y-1,2)},y>1,0< \frac{b^{y-1}(y-1)}{(-a)^y\left(\frac1y-1\right)^y} <1$$

Test this formula here. For $0<y<1$, try the substitution of $x\to x^{\frac1y}$ and cancel powers.

The question’s creator also mentioned excel in a comment, so try using the BETA.INV function instead of InverseBetaRegularized

Тyma Gaidash
  • 13,576
1

We have

$$y=-\frac{\ln(ax-b)+2k\pi i}{\ln(x)}.$$

The function $x\mapsto -\frac{\ln(ax-b)+2k\pi i}{\ln(x)}$ doesn't have a partial inverse that is an elementary function.
It's an open question if the equation has solutions that are elementary numbers.
$\ $

$$x^y=ax-b$$

$$x^y-ax+b=0$$

$$e^{\ln(x)y}-ax+b=0$$

LambertW cannot be applied either.
$\ $

$$x^y=ax-b$$

For rational $y$, this equation is related to an algebraic equation and we can use the known solution formulas and methods for algebraic equations.
For rational $y\neq 0,1$, the equation is related to a trinomial equation.
For real or complex $y\neq 0,1$, the equation is in a form similar to a trinomial equation. A closed-form solution can be obtained using confluent Fox-Wright Function $\ _1\Psi_1$ therefore.
$\ $

Szabó, P. G.: On the roots of the trinomial equation. Centr. Eur. J. Operat. Res. 18 (2010) (1) 97-104

Belkić, D.: All the trinomial roots, their powers and logarithms from the Lambert series, Bell polynomials and Fox–Wright function: illustration for genome multiplicity in survival of irradiated cells. J. Math. Chem. 57 (2019) 59-106

IV_
  • 7,902