8

I am currently working on a paper and require an equation with e^x. I tried using the suggested layout of $\exp(x)$ but my output only shows an equation with exp(x) in the PDF output. Is there something that I am doing wrong is is there a specific package I need to use?

Any help would be appreciated.

8
  • 3
    Welcome to TeX.SX! Your question is not very clear: does by any chance $e^{x}$ do what you want?
    – GuM
    Sep 5, 2018 at 10:48
  • Yes it does but I am confused why the alternative notation would not work since I have ensured that I did not make any mistakes in writing the $\exp(x)$ Sep 5, 2018 at 10:54
  • 2
    The alternative notation is just that: there is no “translation” of \exp(x) into e^{x}. There are cases where the former notation is preferable to the latter.
    – egreg
    Sep 5, 2018 at 10:57
  • 8
    The input \exp(x) is specifically meant to generate the word “exp” (in upright font), a left parenthesis, an “x” in math italic font, and a closing parenthesis. In LaTeX, to add a superscript to something you must use the ^ notation. I advise you not to try to write anything in LaTeX without having previously read an introductory guide (at least).
    – GuM
    Sep 5, 2018 at 10:58
  • 4
    As already mentioned, \exp is an alternative notation to e^{...} that users should know. Sadly not everyone does. Consider \[\exp\biggl(\int_0^1 fdx\biggr) \qquad e^{\int_0^1 fdx} \] which of these are more redable? There are many examples of this where there are a short notation for simple input, and a companion notation for complicated input.
    – daleif
    Sep 5, 2018 at 11:05

1 Answer 1

17

I think you may have misunderstood what you have been told.

\exp(x) is not an alternative to e^{x} in LaTeX, exp(x) is an alternative to ex in maths and physics etc.

The exp(x) notation is useful where x is some large or complicated expression, e.g.:

\[
  \exp\biggl(\, \sum_{n=1}^{10} \frac{1}{n} \biggr)
\]

enter image description here

Which I certainly think is a big improvement over:

\[
  e^{\sum_{n=1}^{10} \frac{1}{n}}
\]

enter image description here

The ex notation is useful where x is something nice and small, like, well:

\[
  e^{x}
\]

enter image description here

So LaTeX supports both, \exp(x) for exp(x) and e^{x} for ex. \exp(x) is not a LaTeX shorthand (longhand?) for e^{x} = ex.

5
  • 1
    A further improvement is adding \, between \biggl( and \sum: try and judge for yourself.
    – egreg
    Sep 5, 2018 at 12:43
  • @egreg I wanted to do that, but I didn't trust my own judgement, I'll make the change, thanks!
    – Au101
    Sep 5, 2018 at 12:44
  • 1
    I recommend \, also when a radical is followed by a parenthesis with a similar height, for instance (and in other cases).
    – egreg
    Sep 5, 2018 at 12:46
  • Good obs @egreg!! Do you know about automatic spacing? Why \, but \; no? Is subjective?
    – manooooh
    Sep 5, 2018 at 13:08
  • 2
    @manooooh \; is too much; a thin space is usually the best.
    – egreg
    Sep 5, 2018 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .