Logarithm of exponentialHow to take the derivative w.r.t. an arbitrary function?How can I separate two parts of power of Exponential functions?Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?Computing approximations of exponentialExtracting the Argument of a Complex ExponentialError for some specific values in Matrix exponentialEvaluate complex exponential expressionRe[“Complex Exponential”] does not return Cosine

Was Self-modifying-code possible just using BASIC?

How to avoid typing 'git' at the begining of every Git command

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

How many potential different endings are there for a football match?

Generate certain list from two lists

Most valuable information/technology for rebuilding after the apocalypse?

Convert only certain words to lowercase

What would be the way to say "just saying" in German? (Not the literal translation)

How can one's career as a reviewer be ended?

Why did the World Bank set the global poverty line at $1.90?

Use 1 9 6 2 in this order to make 75

Make Gimbap cutter

Remove border lines of SRTM tiles rendered as hillshade

What does 妄想ダダもれ mean?

Grandpa has another non math question

That's not my X, its Y is too Z

Converting from CMYK to RGB (to work with it), then back to CMYK

Is Lambda Calculus purely syntactic?

Why are ambiguous grammars bad?

What plausible reason could I give for my FTL drive only working in space

Confused with atmospheric pressure equals plastic balloon’s inner pressure

Could a person damage a jet airliner - from the outside - with their bare hands?

What is the reason for setting flaps 1 on the ground at high temperatures?

How to find a better angle and distance for clicking picture of a distorted artwork to achieve 3D effect?



Logarithm of exponential


How to take the derivative w.r.t. an arbitrary function?How can I separate two parts of power of Exponential functions?Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?Computing approximations of exponentialExtracting the Argument of a Complex ExponentialError for some specific values in Matrix exponentialEvaluate complex exponential expressionRe[“Complex Exponential”] does not return Cosine













14












$begingroup$


Ok, this is awkward.



E^Log[a]


gives a, which is what I expected, BUT,



Log[E^a]


is not evaluated at all (I expected the result to be a—this is actually an MWE, what I was trying to do was more complex).



Since I still struggle to understand some of Mathematica's concepts (like when expressions are/n't evaluated), I thought (wrongly, it seems) that it was an Evaluate or Assumptions issue, but now I think it wasn't. I tried:



Assuming[a ∈ Reals, Log[E^a]] // Evaluate
Assuming[a > 0, Log[Exp[a]]] // Simplify


and other variants—which in turn shows that I'm giving a shot in the dark.



What is the explanation for this behavior? How do I get to a? Am I missing an assumption? I don't really care about any weird special cases, a is real, not complex, nor a function, nor anything else.



It obviously seems that I'm missing something (possibly very simple and obvious), but I can't figure out what.










share|improve this question











$endgroup$
















    14












    $begingroup$


    Ok, this is awkward.



    E^Log[a]


    gives a, which is what I expected, BUT,



    Log[E^a]


    is not evaluated at all (I expected the result to be a—this is actually an MWE, what I was trying to do was more complex).



    Since I still struggle to understand some of Mathematica's concepts (like when expressions are/n't evaluated), I thought (wrongly, it seems) that it was an Evaluate or Assumptions issue, but now I think it wasn't. I tried:



    Assuming[a ∈ Reals, Log[E^a]] // Evaluate
    Assuming[a > 0, Log[Exp[a]]] // Simplify


    and other variants—which in turn shows that I'm giving a shot in the dark.



    What is the explanation for this behavior? How do I get to a? Am I missing an assumption? I don't really care about any weird special cases, a is real, not complex, nor a function, nor anything else.



    It obviously seems that I'm missing something (possibly very simple and obvious), but I can't figure out what.










    share|improve this question











    $endgroup$














      14












      14








      14


      3



      $begingroup$


      Ok, this is awkward.



      E^Log[a]


      gives a, which is what I expected, BUT,



      Log[E^a]


      is not evaluated at all (I expected the result to be a—this is actually an MWE, what I was trying to do was more complex).



      Since I still struggle to understand some of Mathematica's concepts (like when expressions are/n't evaluated), I thought (wrongly, it seems) that it was an Evaluate or Assumptions issue, but now I think it wasn't. I tried:



      Assuming[a ∈ Reals, Log[E^a]] // Evaluate
      Assuming[a > 0, Log[Exp[a]]] // Simplify


      and other variants—which in turn shows that I'm giving a shot in the dark.



      What is the explanation for this behavior? How do I get to a? Am I missing an assumption? I don't really care about any weird special cases, a is real, not complex, nor a function, nor anything else.



      It obviously seems that I'm missing something (possibly very simple and obvious), but I can't figure out what.










      share|improve this question











      $endgroup$




      Ok, this is awkward.



      E^Log[a]


      gives a, which is what I expected, BUT,



      Log[E^a]


      is not evaluated at all (I expected the result to be a—this is actually an MWE, what I was trying to do was more complex).



      Since I still struggle to understand some of Mathematica's concepts (like when expressions are/n't evaluated), I thought (wrongly, it seems) that it was an Evaluate or Assumptions issue, but now I think it wasn't. I tried:



      Assuming[a ∈ Reals, Log[E^a]] // Evaluate
      Assuming[a > 0, Log[Exp[a]]] // Simplify


      and other variants—which in turn shows that I'm giving a shot in the dark.



      What is the explanation for this behavior? How do I get to a? Am I missing an assumption? I don't really care about any weird special cases, a is real, not complex, nor a function, nor anything else.



      It obviously seems that I'm missing something (possibly very simple and obvious), but I can't figure out what.







      functions version-11






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 4 at 18:49









      Carl Woll

      83.3k3105216




      83.3k3105216










      asked Jun 4 at 2:42









      RafaelRafael

      257311




      257311




















          3 Answers
          3






          active

          oldest

          votes


















          16












          $begingroup$

          Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g.,



          Simplify[Log[E^a], a ∈ Reals]



          a




          or



          Simplify[Log[E^a], a > 0]



          a




          as suggested in the other answer. Another method is to use PowerExpand:



          PowerExpand[Log[E^a], Assumptions -> True]



          a + 2 I π Floor[1/2 - Im[a]/(2 π)]




          Addendum



          As an aside, Log behave exactly like ArcSin here:



          ArcSin[Sin[x]]



          ArcSin[Sin[x]]




          Including a domain restriction:



          Simplify[ArcSin[Sin[x]], -Pi/2 < x < Pi/2]



          x




          For larger domains, Simplify doesn't work:



          Simplify[ArcSin[Sin[x]], 0 < x < 2 Pi]



          ArcSin[Sin[x]]




          Again, using PowerExpand is useful:



          p = PowerExpand[ArcSin[Sin[x]], Assumptions -> 0 < x < 2Pi];
          p //TeXForm



          $begincases
          pi -x & fracpi 2<xleq frac3 pi 2 \
          x & xleq fracpi 2 \
          x-2 pi & textTrue
          endcases$




          Visualization:



          GraphicsColumn[
          Plot[ArcSin[Sin[x]], x, 0, 2 Pi],
          Plot[p, x, 0, 2 Pi]
          ]


          enter image description here






          share|improve this answer











          $endgroup$












          • $begingroup$
            Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
            $endgroup$
            – Rafael
            Jun 4 at 16:10







          • 4




            $begingroup$
            Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
            $endgroup$
            – Carl Woll
            Jun 4 at 16:17










          • $begingroup$
            I see, silly me. Thanks
            $endgroup$
            – Rafael
            Jun 4 at 16:20


















          14












          $begingroup$

          The assumption a > 0 is needed when Simplify is called:



          Assuming[a > 0, Log[Exp[a]] // Simplify]



          a







          share|improve this answer









          $endgroup$








          • 8




            $begingroup$
            a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
            $endgroup$
            – Michael E2
            Jun 4 at 2:59






          • 2




            $begingroup$
            Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
            $endgroup$
            – Rafael
            Jun 4 at 3:01






          • 8




            $begingroup$
            @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
            $endgroup$
            – Bob Hanlon
            Jun 4 at 4:06










          • $begingroup$
            @BobHanlon, Ok, I see. Thank you for your answer.
            $endgroup$
            – Rafael
            Jun 4 at 4:40


















          0












          $begingroup$

          Logarithm is a problematic function for MMA. I do not know the reason. One can see, for example Log[a] + Log[b] // Simplify returns Log[a] + Log[b] though LeafCount[Log[a] + Log[b]] yields 5, while LeafCount[Log[a*b]] gives 4.



          I do not think that in the case Log[E^a] we should use such conditions as a>0 or whatever, since the relation in question is universal. On the other hand, in the case Log[E^a]===a the expression a is doubtless much simpler and, therefore, preferable. It is not that clear what one prefers to have in the case Log[a] + Log[b]



          The way around can be using rules. For example, in this case one may use



          rule = Log[x_^y_] :> y*Log[x];


          Then its application gives



          In[5]:= Log[E^a] /. rule

          (* Out[5]= a *)


          Have fun!






          share|improve this answer









          $endgroup$












          • $begingroup$
            Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
            $endgroup$
            – Rafael
            Jun 4 at 12:28






          • 2




            $begingroup$
            @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
            $endgroup$
            – Alexei Boulbitch
            Jun 4 at 12:52










          • $begingroup$
            @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
            $endgroup$
            – Davidmh
            Jun 4 at 14:00






          • 1




            $begingroup$
            @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
            $endgroup$
            – Davidmh
            Jun 4 at 14:39






          • 4




            $begingroup$
            In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
            $endgroup$
            – Daniel Lichtblau
            Jun 4 at 16:17











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "387"
          ;
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199679%2flogarithm-of-exponential%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          16












          $begingroup$

          Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g.,



          Simplify[Log[E^a], a ∈ Reals]



          a




          or



          Simplify[Log[E^a], a > 0]



          a




          as suggested in the other answer. Another method is to use PowerExpand:



          PowerExpand[Log[E^a], Assumptions -> True]



          a + 2 I π Floor[1/2 - Im[a]/(2 π)]




          Addendum



          As an aside, Log behave exactly like ArcSin here:



          ArcSin[Sin[x]]



          ArcSin[Sin[x]]




          Including a domain restriction:



          Simplify[ArcSin[Sin[x]], -Pi/2 < x < Pi/2]



          x




          For larger domains, Simplify doesn't work:



          Simplify[ArcSin[Sin[x]], 0 < x < 2 Pi]



          ArcSin[Sin[x]]




          Again, using PowerExpand is useful:



          p = PowerExpand[ArcSin[Sin[x]], Assumptions -> 0 < x < 2Pi];
          p //TeXForm



          $begincases
          pi -x & fracpi 2<xleq frac3 pi 2 \
          x & xleq fracpi 2 \
          x-2 pi & textTrue
          endcases$




          Visualization:



          GraphicsColumn[
          Plot[ArcSin[Sin[x]], x, 0, 2 Pi],
          Plot[p, x, 0, 2 Pi]
          ]


          enter image description here






          share|improve this answer











          $endgroup$












          • $begingroup$
            Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
            $endgroup$
            – Rafael
            Jun 4 at 16:10







          • 4




            $begingroup$
            Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
            $endgroup$
            – Carl Woll
            Jun 4 at 16:17










          • $begingroup$
            I see, silly me. Thanks
            $endgroup$
            – Rafael
            Jun 4 at 16:20















          16












          $begingroup$

          Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g.,



          Simplify[Log[E^a], a ∈ Reals]



          a




          or



          Simplify[Log[E^a], a > 0]



          a




          as suggested in the other answer. Another method is to use PowerExpand:



          PowerExpand[Log[E^a], Assumptions -> True]



          a + 2 I π Floor[1/2 - Im[a]/(2 π)]




          Addendum



          As an aside, Log behave exactly like ArcSin here:



          ArcSin[Sin[x]]



          ArcSin[Sin[x]]




          Including a domain restriction:



          Simplify[ArcSin[Sin[x]], -Pi/2 < x < Pi/2]



          x




          For larger domains, Simplify doesn't work:



          Simplify[ArcSin[Sin[x]], 0 < x < 2 Pi]



          ArcSin[Sin[x]]




          Again, using PowerExpand is useful:



          p = PowerExpand[ArcSin[Sin[x]], Assumptions -> 0 < x < 2Pi];
          p //TeXForm



          $begincases
          pi -x & fracpi 2<xleq frac3 pi 2 \
          x & xleq fracpi 2 \
          x-2 pi & textTrue
          endcases$




          Visualization:



          GraphicsColumn[
          Plot[ArcSin[Sin[x]], x, 0, 2 Pi],
          Plot[p, x, 0, 2 Pi]
          ]


          enter image description here






          share|improve this answer











          $endgroup$












          • $begingroup$
            Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
            $endgroup$
            – Rafael
            Jun 4 at 16:10







          • 4




            $begingroup$
            Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
            $endgroup$
            – Carl Woll
            Jun 4 at 16:17










          • $begingroup$
            I see, silly me. Thanks
            $endgroup$
            – Rafael
            Jun 4 at 16:20













          16












          16








          16





          $begingroup$

          Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g.,



          Simplify[Log[E^a], a ∈ Reals]



          a




          or



          Simplify[Log[E^a], a > 0]



          a




          as suggested in the other answer. Another method is to use PowerExpand:



          PowerExpand[Log[E^a], Assumptions -> True]



          a + 2 I π Floor[1/2 - Im[a]/(2 π)]




          Addendum



          As an aside, Log behave exactly like ArcSin here:



          ArcSin[Sin[x]]



          ArcSin[Sin[x]]




          Including a domain restriction:



          Simplify[ArcSin[Sin[x]], -Pi/2 < x < Pi/2]



          x




          For larger domains, Simplify doesn't work:



          Simplify[ArcSin[Sin[x]], 0 < x < 2 Pi]



          ArcSin[Sin[x]]




          Again, using PowerExpand is useful:



          p = PowerExpand[ArcSin[Sin[x]], Assumptions -> 0 < x < 2Pi];
          p //TeXForm



          $begincases
          pi -x & fracpi 2<xleq frac3 pi 2 \
          x & xleq fracpi 2 \
          x-2 pi & textTrue
          endcases$




          Visualization:



          GraphicsColumn[
          Plot[ArcSin[Sin[x]], x, 0, 2 Pi],
          Plot[p, x, 0, 2 Pi]
          ]


          enter image description here






          share|improve this answer











          $endgroup$



          Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g.,



          Simplify[Log[E^a], a ∈ Reals]



          a




          or



          Simplify[Log[E^a], a > 0]



          a




          as suggested in the other answer. Another method is to use PowerExpand:



          PowerExpand[Log[E^a], Assumptions -> True]



          a + 2 I π Floor[1/2 - Im[a]/(2 π)]




          Addendum



          As an aside, Log behave exactly like ArcSin here:



          ArcSin[Sin[x]]



          ArcSin[Sin[x]]




          Including a domain restriction:



          Simplify[ArcSin[Sin[x]], -Pi/2 < x < Pi/2]



          x




          For larger domains, Simplify doesn't work:



          Simplify[ArcSin[Sin[x]], 0 < x < 2 Pi]



          ArcSin[Sin[x]]




          Again, using PowerExpand is useful:



          p = PowerExpand[ArcSin[Sin[x]], Assumptions -> 0 < x < 2Pi];
          p //TeXForm



          $begincases
          pi -x & fracpi 2<xleq frac3 pi 2 \
          x & xleq fracpi 2 \
          x-2 pi & textTrue
          endcases$




          Visualization:



          GraphicsColumn[
          Plot[ArcSin[Sin[x]], x, 0, 2 Pi],
          Plot[p, x, 0, 2 Pi]
          ]


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 4 at 18:48

























          answered Jun 4 at 3:08









          Carl WollCarl Woll

          83.3k3105216




          83.3k3105216











          • $begingroup$
            Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
            $endgroup$
            – Rafael
            Jun 4 at 16:10







          • 4




            $begingroup$
            Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
            $endgroup$
            – Carl Woll
            Jun 4 at 16:17










          • $begingroup$
            I see, silly me. Thanks
            $endgroup$
            – Rafael
            Jun 4 at 16:20
















          • $begingroup$
            Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
            $endgroup$
            – Rafael
            Jun 4 at 16:10







          • 4




            $begingroup$
            Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
            $endgroup$
            – Carl Woll
            Jun 4 at 16:17










          • $begingroup$
            I see, silly me. Thanks
            $endgroup$
            – Rafael
            Jun 4 at 16:20















          $begingroup$
          Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
          $endgroup$
          – Rafael
          Jun 4 at 16:10





          $begingroup$
          Nice explanation! Is there/Shouldn't there be a standard, single valued version of Log, just as the classical, ubiquitous asin, acos, atan? (I know this question may be beyond Mathematica). Is there a mathematical reason for the different treatment? Is it just for historic/convenience/arbitrary reasons?
          $endgroup$
          – Rafael
          Jun 4 at 16:10





          4




          4




          $begingroup$
          Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
          $endgroup$
          – Carl Woll
          Jun 4 at 16:17




          $begingroup$
          Rafael Log is a standard single valued function when given numerical input. When given symbolic input, Log is not able to figure out the right branch to use without assumptions. This is exactly how ArcSin etc, behave, e.g., ArcSin[Sin[x]] returns it's input.
          $endgroup$
          – Carl Woll
          Jun 4 at 16:17












          $begingroup$
          I see, silly me. Thanks
          $endgroup$
          – Rafael
          Jun 4 at 16:20




          $begingroup$
          I see, silly me. Thanks
          $endgroup$
          – Rafael
          Jun 4 at 16:20











          14












          $begingroup$

          The assumption a > 0 is needed when Simplify is called:



          Assuming[a > 0, Log[Exp[a]] // Simplify]



          a







          share|improve this answer









          $endgroup$








          • 8




            $begingroup$
            a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
            $endgroup$
            – Michael E2
            Jun 4 at 2:59






          • 2




            $begingroup$
            Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
            $endgroup$
            – Rafael
            Jun 4 at 3:01






          • 8




            $begingroup$
            @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
            $endgroup$
            – Bob Hanlon
            Jun 4 at 4:06










          • $begingroup$
            @BobHanlon, Ok, I see. Thank you for your answer.
            $endgroup$
            – Rafael
            Jun 4 at 4:40















          14












          $begingroup$

          The assumption a > 0 is needed when Simplify is called:



          Assuming[a > 0, Log[Exp[a]] // Simplify]



          a







          share|improve this answer









          $endgroup$








          • 8




            $begingroup$
            a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
            $endgroup$
            – Michael E2
            Jun 4 at 2:59






          • 2




            $begingroup$
            Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
            $endgroup$
            – Rafael
            Jun 4 at 3:01






          • 8




            $begingroup$
            @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
            $endgroup$
            – Bob Hanlon
            Jun 4 at 4:06










          • $begingroup$
            @BobHanlon, Ok, I see. Thank you for your answer.
            $endgroup$
            – Rafael
            Jun 4 at 4:40













          14












          14








          14





          $begingroup$

          The assumption a > 0 is needed when Simplify is called:



          Assuming[a > 0, Log[Exp[a]] // Simplify]



          a







          share|improve this answer









          $endgroup$



          The assumption a > 0 is needed when Simplify is called:



          Assuming[a > 0, Log[Exp[a]] // Simplify]



          a








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 4 at 2:54









          CoolwaterCoolwater

          15.9k32554




          15.9k32554







          • 8




            $begingroup$
            a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
            $endgroup$
            – Michael E2
            Jun 4 at 2:59






          • 2




            $begingroup$
            Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
            $endgroup$
            – Rafael
            Jun 4 at 3:01






          • 8




            $begingroup$
            @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
            $endgroup$
            – Bob Hanlon
            Jun 4 at 4:06










          • $begingroup$
            @BobHanlon, Ok, I see. Thank you for your answer.
            $endgroup$
            – Rafael
            Jun 4 at 4:40












          • 8




            $begingroup$
            a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
            $endgroup$
            – Michael E2
            Jun 4 at 2:59






          • 2




            $begingroup$
            Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
            $endgroup$
            – Rafael
            Jun 4 at 3:01






          • 8




            $begingroup$
            @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
            $endgroup$
            – Bob Hanlon
            Jun 4 at 4:06










          • $begingroup$
            @BobHanlon, Ok, I see. Thank you for your answer.
            $endgroup$
            – Rafael
            Jun 4 at 4:40







          8




          8




          $begingroup$
          a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
          $endgroup$
          – Michael E2
          Jun 4 at 2:59




          $begingroup$
          a [Element] Reals works, too. The problem with complex a is that Log[Exp[a + 2 Pi I]] and Log[Exp[a]] are equal.
          $endgroup$
          – Michael E2
          Jun 4 at 2:59




          2




          2




          $begingroup$
          Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
          $endgroup$
          – Rafael
          Jun 4 at 3:01




          $begingroup$
          Thanks. Is there a good reason why Assuming[a > 0, Log[Exp[a]]] won't just evaluate to a? I don't get it. (cc: @MichaelE2 )
          $endgroup$
          – Rafael
          Jun 4 at 3:01




          8




          8




          $begingroup$
          @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
          $endgroup$
          – Bob Hanlon
          Jun 4 at 4:06




          $begingroup$
          @Rafael - The assumptions specified in Assuming only affect functions that take the option Assumptions. Neither Log nor Exp take options. You need to include Simplify or FullSimplify within the Assuming for the assumptions to be used.
          $endgroup$
          – Bob Hanlon
          Jun 4 at 4:06












          $begingroup$
          @BobHanlon, Ok, I see. Thank you for your answer.
          $endgroup$
          – Rafael
          Jun 4 at 4:40




          $begingroup$
          @BobHanlon, Ok, I see. Thank you for your answer.
          $endgroup$
          – Rafael
          Jun 4 at 4:40











          0












          $begingroup$

          Logarithm is a problematic function for MMA. I do not know the reason. One can see, for example Log[a] + Log[b] // Simplify returns Log[a] + Log[b] though LeafCount[Log[a] + Log[b]] yields 5, while LeafCount[Log[a*b]] gives 4.



          I do not think that in the case Log[E^a] we should use such conditions as a>0 or whatever, since the relation in question is universal. On the other hand, in the case Log[E^a]===a the expression a is doubtless much simpler and, therefore, preferable. It is not that clear what one prefers to have in the case Log[a] + Log[b]



          The way around can be using rules. For example, in this case one may use



          rule = Log[x_^y_] :> y*Log[x];


          Then its application gives



          In[5]:= Log[E^a] /. rule

          (* Out[5]= a *)


          Have fun!






          share|improve this answer









          $endgroup$












          • $begingroup$
            Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
            $endgroup$
            – Rafael
            Jun 4 at 12:28






          • 2




            $begingroup$
            @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
            $endgroup$
            – Alexei Boulbitch
            Jun 4 at 12:52










          • $begingroup$
            @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
            $endgroup$
            – Davidmh
            Jun 4 at 14:00






          • 1




            $begingroup$
            @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
            $endgroup$
            – Davidmh
            Jun 4 at 14:39






          • 4




            $begingroup$
            In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
            $endgroup$
            – Daniel Lichtblau
            Jun 4 at 16:17















          0












          $begingroup$

          Logarithm is a problematic function for MMA. I do not know the reason. One can see, for example Log[a] + Log[b] // Simplify returns Log[a] + Log[b] though LeafCount[Log[a] + Log[b]] yields 5, while LeafCount[Log[a*b]] gives 4.



          I do not think that in the case Log[E^a] we should use such conditions as a>0 or whatever, since the relation in question is universal. On the other hand, in the case Log[E^a]===a the expression a is doubtless much simpler and, therefore, preferable. It is not that clear what one prefers to have in the case Log[a] + Log[b]



          The way around can be using rules. For example, in this case one may use



          rule = Log[x_^y_] :> y*Log[x];


          Then its application gives



          In[5]:= Log[E^a] /. rule

          (* Out[5]= a *)


          Have fun!






          share|improve this answer









          $endgroup$












          • $begingroup$
            Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
            $endgroup$
            – Rafael
            Jun 4 at 12:28






          • 2




            $begingroup$
            @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
            $endgroup$
            – Alexei Boulbitch
            Jun 4 at 12:52










          • $begingroup$
            @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
            $endgroup$
            – Davidmh
            Jun 4 at 14:00






          • 1




            $begingroup$
            @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
            $endgroup$
            – Davidmh
            Jun 4 at 14:39






          • 4




            $begingroup$
            In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
            $endgroup$
            – Daniel Lichtblau
            Jun 4 at 16:17













          0












          0








          0





          $begingroup$

          Logarithm is a problematic function for MMA. I do not know the reason. One can see, for example Log[a] + Log[b] // Simplify returns Log[a] + Log[b] though LeafCount[Log[a] + Log[b]] yields 5, while LeafCount[Log[a*b]] gives 4.



          I do not think that in the case Log[E^a] we should use such conditions as a>0 or whatever, since the relation in question is universal. On the other hand, in the case Log[E^a]===a the expression a is doubtless much simpler and, therefore, preferable. It is not that clear what one prefers to have in the case Log[a] + Log[b]



          The way around can be using rules. For example, in this case one may use



          rule = Log[x_^y_] :> y*Log[x];


          Then its application gives



          In[5]:= Log[E^a] /. rule

          (* Out[5]= a *)


          Have fun!






          share|improve this answer









          $endgroup$



          Logarithm is a problematic function for MMA. I do not know the reason. One can see, for example Log[a] + Log[b] // Simplify returns Log[a] + Log[b] though LeafCount[Log[a] + Log[b]] yields 5, while LeafCount[Log[a*b]] gives 4.



          I do not think that in the case Log[E^a] we should use such conditions as a>0 or whatever, since the relation in question is universal. On the other hand, in the case Log[E^a]===a the expression a is doubtless much simpler and, therefore, preferable. It is not that clear what one prefers to have in the case Log[a] + Log[b]



          The way around can be using rules. For example, in this case one may use



          rule = Log[x_^y_] :> y*Log[x];


          Then its application gives



          In[5]:= Log[E^a] /. rule

          (* Out[5]= a *)


          Have fun!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 4 at 11:49









          Alexei BoulbitchAlexei Boulbitch

          22.6k2775




          22.6k2775











          • $begingroup$
            Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
            $endgroup$
            – Rafael
            Jun 4 at 12:28






          • 2




            $begingroup$
            @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
            $endgroup$
            – Alexei Boulbitch
            Jun 4 at 12:52










          • $begingroup$
            @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
            $endgroup$
            – Davidmh
            Jun 4 at 14:00






          • 1




            $begingroup$
            @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
            $endgroup$
            – Davidmh
            Jun 4 at 14:39






          • 4




            $begingroup$
            In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
            $endgroup$
            – Daniel Lichtblau
            Jun 4 at 16:17
















          • $begingroup$
            Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
            $endgroup$
            – Rafael
            Jun 4 at 12:28






          • 2




            $begingroup$
            @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
            $endgroup$
            – Alexei Boulbitch
            Jun 4 at 12:52










          • $begingroup$
            @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
            $endgroup$
            – Davidmh
            Jun 4 at 14:00






          • 1




            $begingroup$
            @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
            $endgroup$
            – Davidmh
            Jun 4 at 14:39






          • 4




            $begingroup$
            In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
            $endgroup$
            – Daniel Lichtblau
            Jun 4 at 16:17















          $begingroup$
          Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
          $endgroup$
          – Rafael
          Jun 4 at 12:28




          $begingroup$
          Would you say you disagree with the other answers, then? I'd love to read more debate on the issue, if it is somehow contentious
          $endgroup$
          – Rafael
          Jun 4 at 12:28




          2




          2




          $begingroup$
          @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
          $endgroup$
          – Alexei Boulbitch
          Jun 4 at 12:52




          $begingroup$
          @Rafael No, I do not. However, they used some conditions imposed on a to achieve the desired results. We know, however, that the relation Log[Exp[a]]===a holds for any a. So, using the relation, say, a>0 is to extent misleading. Indeed, in this case, we know that it holds for any a. However, in a more cumbersome case this condition may lead you into an erroneous assumption that such an inequality is necessary. Anyway, one should be careful.
          $endgroup$
          – Alexei Boulbitch
          Jun 4 at 12:52












          $begingroup$
          @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
          $endgroup$
          – Davidmh
          Jun 4 at 14:00




          $begingroup$
          @AlexeiBoulbitch the expression isn't general for complex values of a. a > 0 forces a into the reals. Also, consider a = -1 + I, b=-1; the sum of the logs is not the log of the product.
          $endgroup$
          – Davidmh
          Jun 4 at 14:00




          1




          1




          $begingroup$
          @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
          $endgroup$
          – Davidmh
          Jun 4 at 14:39




          $begingroup$
          @AlexeiBoulbitch sorry, I was unclear. I should have split my comment: Log[Exp[a]]===a isn't general for complex values of a (in particular, when Abs[Im[a]] > 2 Pi), but a > 0 forces a into the reals. Furthermore, Log[a] + Log[b] is not, in general, Log[a*b] if a or b are complex.
          $endgroup$
          – Davidmh
          Jun 4 at 14:39




          4




          4




          $begingroup$
          In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
          $endgroup$
          – Daniel Lichtblau
          Jun 4 at 16:17




          $begingroup$
          In[33]:= Log[Exp[a]] /. a->-1-5*I Out[33]= (-1 - 5 I) + (2 I) Pi So this claimed identity is simply wrong. As has been noted in the comment by @Davidmh
          $endgroup$
          – Daniel Lichtblau
          Jun 4 at 16:17

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199679%2flogarithm-of-exponential%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?