1

I'm trying to solve $ax = \log(x)^b$, where $a$ is a positive number, $b$ is a positive integer, and $\log$ is the natural logarithm.

Solving this equation is coming up when calculating the number of sample points needed to reach an error bound when using low-discrepancy sequences (such as Sobol's sequence) for Quasi-Monte Carlo integration. If I need to I can use a root finding algorithm to approximate this, but it would be nice to have a closed-form solution. How to approach this equation is definitely above my ability level.

Shaun
  • 44,997
Scott
  • 353
  • 2
  • 7

3 Answers3

2

Not a closed form solution in terms of elementary functions but you might be able to find one in terms of the "Lambert W function", defined as the inverse function to $f(x)= xe^x$.

user247327
  • 18,710
  • I did run across that, however I think that my function $f(x) = xe^{x^b}}$ is a different beast and I couldn't find a generalization of the Lambert W function that covered that case. – Scott Jul 07 '21 at 21:36
  • Actually this does help - the fact that the specific case b=1 here does not have a closed form solution means that the general case does not either. This ended up converging pretty quickly using a root-finding package, so that's the approach I'll go for. Thanks! – Scott Jul 07 '21 at 22:26
2

As others have mentioned, there's no closed form using the standard functions, but it can be solved using the Lambert W (which has been in use for so long now that it really ought to be considered a standard function, IMHO).

If you aren't used to working with the Lambert W, it may not seem obvious how to apply it here. But you just need to manipulate your expression until you get an expression involving $ze^z$ for some $z$.

$$ax = \ln(x)^b$$ Now $x>0$ so we can substitute $x = e^u$ $$ae^u = u^b$$ $$a^{1/b}e^{u/b} = u$$ $$(a^{1/b}/b)e^{u/b} = u/b$$ Let $y=-u/b$ $$(a^{1/b}/b)e^{-y} = -y$$ $$(-a^{1/b}/b) = ye^y$$ We can now apply the Lambert W: $$W(-a^{1/b}/b) = W(ye^y) = y$$ So $$-u/b = W(-a^{1/b}/b)$$ That is, $$x = \exp(-b\, W(-a^{1/b}/b))$$

The Lambert W is multi-branched, for real-valued equations we need to look at the -1 and 0 branches.


Here's a short Sage / Python script which solves this problem. (Sage is built on top of Python, so if you can write Python, it's not too hard to pick up Sage). Sage uses ^ for exponentiation, and it has the Lambert W.

My code uses $a=0.5, b=2$ as its defaults.

Code

@interact
def main(a=0.5, b=2):
    y = -a ^ (1/b) / b
    for k in (0, -1):
        x = exp(-b * lambert_w(k, y))
        print("x:", x)
        print(a * x, ln(x) ^ b)

Output

x: 4.42806221672321
2.21403110836160 2.21403110836160
x: 13.7064512076198
6.85322560380990 6.85322560380990

Here's a live version you can play with on the SageMathCell server.

PM 2Ring
  • 4,844
  • If you don't have easy access to the Lambert W then you can use Newton's method to solve equations like this one. My answer here goes into more details: https://math.stackexchange.com/a/3991940/207316 – PM 2Ring Jul 07 '21 at 22:47
0

Let $m=\frac{a}{b}$. A straight line $y= (m\approx 0.38)\cdot x $ is tangential to $ y= \log x $.

For slopes higher than this no real solutions,and for $m<.38$ there are two solutions.

Strictly for lower slope when linear and log (trig, hyp functions) appear together solutions are from transcendental equations, so are not analytical or closed form ...but can be expressed in terms of Lambert W function which can be counted as analytical.

Narasimham
  • 40,495