Inverse of $f(x) = fracxlog(x)$
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
$pi(x)$ is defined as number of primes less than or equal to x. Gauss showed that $pi(x) approx fracxlog(x)$. I want to calculate the inverse of that approximation because I want to estimate how far should I sieve in order to get the number of primes that I want. Here are the steps that I took.
$$beginaligny &= fracxlog(x)\ x &= y log(x) \ e^x&=e^ylog(x) \ e^x &= (e^log(x))^y \ e^x &= x^yendalign$$
I am stuck at this point. How can I calculate $y$ in terms of $x$?
logarithms inverse-function
add a comment |Â
up vote
2
down vote
favorite
$pi(x)$ is defined as number of primes less than or equal to x. Gauss showed that $pi(x) approx fracxlog(x)$. I want to calculate the inverse of that approximation because I want to estimate how far should I sieve in order to get the number of primes that I want. Here are the steps that I took.
$$beginaligny &= fracxlog(x)\ x &= y log(x) \ e^x&=e^ylog(x) \ e^x &= (e^log(x))^y \ e^x &= x^yendalign$$
I am stuck at this point. How can I calculate $y$ in terms of $x$?
logarithms inverse-function
2
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
1
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
$pi(x)$ is defined as number of primes less than or equal to x. Gauss showed that $pi(x) approx fracxlog(x)$. I want to calculate the inverse of that approximation because I want to estimate how far should I sieve in order to get the number of primes that I want. Here are the steps that I took.
$$beginaligny &= fracxlog(x)\ x &= y log(x) \ e^x&=e^ylog(x) \ e^x &= (e^log(x))^y \ e^x &= x^yendalign$$
I am stuck at this point. How can I calculate $y$ in terms of $x$?
logarithms inverse-function
$pi(x)$ is defined as number of primes less than or equal to x. Gauss showed that $pi(x) approx fracxlog(x)$. I want to calculate the inverse of that approximation because I want to estimate how far should I sieve in order to get the number of primes that I want. Here are the steps that I took.
$$beginaligny &= fracxlog(x)\ x &= y log(x) \ e^x&=e^ylog(x) \ e^x &= (e^log(x))^y \ e^x &= x^yendalign$$
I am stuck at this point. How can I calculate $y$ in terms of $x$?
logarithms inverse-function
edited Aug 6 at 20:58
gimusi
65.5k73684
65.5k73684
asked Aug 6 at 20:42
yasar
1674
1674
2
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
1
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46
add a comment |Â
2
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
1
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46
2
2
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
1
1
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Resorting to Lambert's $W$ is a little overkill.
With $$x=yln y,$$ we have
$$frac xlog x=fracyln yln(yln y)=fracyln yln y+lnln yapprox y.$$
Given that the distribution is anyway approximate, this can be a sufficient approximation of the inverse. Or you can use it as a starting value for Newton's iterations (use few of them anyway).
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
 |Â
show 5 more comments
up vote
2
down vote
To be clear about what is hinted at in the comments,
$$
f^-1(y) = -y,W(-tfrac1y)
$$
where $W$ is the Lambert-$W$ function. (You can verify this in Mathematica.) If you wanted an asymptotic expansion check the wiki article and plug one in.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Resorting to Lambert's $W$ is a little overkill.
With $$x=yln y,$$ we have
$$frac xlog x=fracyln yln(yln y)=fracyln yln y+lnln yapprox y.$$
Given that the distribution is anyway approximate, this can be a sufficient approximation of the inverse. Or you can use it as a starting value for Newton's iterations (use few of them anyway).
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
 |Â
show 5 more comments
up vote
3
down vote
Resorting to Lambert's $W$ is a little overkill.
With $$x=yln y,$$ we have
$$frac xlog x=fracyln yln(yln y)=fracyln yln y+lnln yapprox y.$$
Given that the distribution is anyway approximate, this can be a sufficient approximation of the inverse. Or you can use it as a starting value for Newton's iterations (use few of them anyway).
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
 |Â
show 5 more comments
up vote
3
down vote
up vote
3
down vote
Resorting to Lambert's $W$ is a little overkill.
With $$x=yln y,$$ we have
$$frac xlog x=fracyln yln(yln y)=fracyln yln y+lnln yapprox y.$$
Given that the distribution is anyway approximate, this can be a sufficient approximation of the inverse. Or you can use it as a starting value for Newton's iterations (use few of them anyway).
Resorting to Lambert's $W$ is a little overkill.
With $$x=yln y,$$ we have
$$frac xlog x=fracyln yln(yln y)=fracyln yln y+lnln yapprox y.$$
Given that the distribution is anyway approximate, this can be a sufficient approximation of the inverse. Or you can use it as a starting value for Newton's iterations (use few of them anyway).
edited Aug 6 at 20:59
answered Aug 6 at 20:50
Yves Daoust
111k665205
111k665205
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
 |Â
show 5 more comments
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
$x = y / ln y$ I think? division not multiplication?
â Claude
Aug 6 at 20:53
1
1
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
@Claude: the problem statement says $y=x/log x$, then $xapprox ylog y$.
â Yves Daoust
Aug 6 at 20:54
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
oh, I see now what you are doing
â Claude
Aug 6 at 20:56
1
1
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
@yasar Try to plug it: set $x := yln y$. Then $$fracxln x = fracyln yln(yln y)) = fracyln yln y + lnln y = fracy1+fraclnln yln y = y - yfraclnln yln y + oleft(yfraclnln yln y right) = y + o(y)$$
â Clement C.
Aug 6 at 21:16
1
1
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
@ClementC. Indeed, but it does work here: it is known that $n (log n + log log n - 1) < p(n) < n (log n + log log n)$ for $n ge 6$.
â Robert Israel
Aug 7 at 4:50
 |Â
show 5 more comments
up vote
2
down vote
To be clear about what is hinted at in the comments,
$$
f^-1(y) = -y,W(-tfrac1y)
$$
where $W$ is the Lambert-$W$ function. (You can verify this in Mathematica.) If you wanted an asymptotic expansion check the wiki article and plug one in.
add a comment |Â
up vote
2
down vote
To be clear about what is hinted at in the comments,
$$
f^-1(y) = -y,W(-tfrac1y)
$$
where $W$ is the Lambert-$W$ function. (You can verify this in Mathematica.) If you wanted an asymptotic expansion check the wiki article and plug one in.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
To be clear about what is hinted at in the comments,
$$
f^-1(y) = -y,W(-tfrac1y)
$$
where $W$ is the Lambert-$W$ function. (You can verify this in Mathematica.) If you wanted an asymptotic expansion check the wiki article and plug one in.
To be clear about what is hinted at in the comments,
$$
f^-1(y) = -y,W(-tfrac1y)
$$
where $W$ is the Lambert-$W$ function. (You can verify this in Mathematica.) If you wanted an asymptotic expansion check the wiki article and plug one in.
answered Aug 6 at 21:02
cdipaolo
527211
527211
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2874297%2finverse-of-fx-fracx-logx%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
For an exact formula, use the Lambert W function, but in your case a numerical method like Newton's method will do.
â Jean-Claude Arbaut
Aug 6 at 20:46
1
I believe you can't do it analytically.
â fonini
Aug 6 at 20:46