Inverse of $f(x) = fracxlog(x)$

The name of the pictureThe name of the pictureThe name of the pictureClash 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$?







share|cite|improve this question

















  • 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














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$?







share|cite|improve this question

















  • 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












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$?







share|cite|improve this question













$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$?









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








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












  • 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










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).






share|cite|improve this answer























  • $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

















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.






share|cite|improve this answer





















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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).






    share|cite|improve this answer























    • $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














    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).






    share|cite|improve this answer























    • $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












    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).






    share|cite|improve this answer















    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).







    share|cite|improve this answer















    share|cite|improve this answer



    share|cite|improve this answer








    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
















    • $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










    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.






    share|cite|improve this answer

























      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.






      share|cite|improve this answer























        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.






        share|cite|improve this answer













        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.







        share|cite|improve this answer













        share|cite|improve this answer



        share|cite|improve this answer











        answered Aug 6 at 21:02









        cdipaolo

        527211




        527211






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Comments

            Popular posts from this blog

            What is the equation of a 3D cone with generalised tilt?

            Relationship between determinant of matrix and determinant of adjoint?

            Color the edges and diagonals of a regular polygon