7

I'm trying to put an integral in an exponent with the following LaTeX:

\begin{align*}
    e^{G(t)} &= e^{\int{\frac{t}{1+t^2}dt}} \\
    &= e^{\frac{1}{2}\ln(1+t^2)} \\
    &= \sqrt{1 + t^2}
\end{align*}

however, the result is this:

awkward spacing

the spacing between the integral and the fraction looks very awkward. I looked into display mode, but that just makes the integral abnormally large. Is there anyway to get rid of that spacing?

ryanyz10
  • 117
  • I found this: https://tex.stackexchange.com/q/233817/120578, this: http://latex.org/forum/viewtopic.php?t=10000 and this: https://stackoverflow.com/questions/1437423/latex-puts-too-much-space-next-to-integrals on this particular problem... – koleygr Jan 20 '18 at 00:52
  • As an aside, \int{...} doesn't really make sense: \int is just a symbol (technically a \mathop), it doesn't take arguments. – Bruno Le Floch Jan 20 '18 at 00:53
  • @koleygr Ah, I did searches specifically for integrals in exponents, but maybe it would've been smarter for me to search more generally... – ryanyz10 Jan 20 '18 at 00:54
  • @BrunoLeFloch Yeah, I just thought the spacing could possibly go away with the \int{...} but I was wrong – ryanyz10 Jan 20 '18 at 00:55

2 Answers2

10

Some alternatives:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
e^{G(t)} &= e^{\int\frac{t}{1+t^2}dt} \\ % original
e^{G(t)} &= e^{\int\!\frac{t}{1+t^2}\,dt} \\
e^{G(t)} &= \exp\Bigl(\int\frac{t}{1+t^2}\,dt\Bigr) \\
e^{G(t)} &= \exp\bigl({\textstyle\int\frac{t}{1+t^2}\,dt}\bigr) \\
         &= e^{\frac{1}{2}\ln(1+t^2)} \\
         &= \sqrt{1 + t^2}
\end{align*}

\end{document}

enter image description here

egreg
  • 1,121,712
  • The \! seems to move it enough to not annoy me, thank you! Unrelated, is \exp an acceptable alternative to e^n? I've never seen that notation before. – ryanyz10 Jan 20 '18 at 00:59
  • 6
    @ryanyz10: \exp(...) for e^{...} is quite standard. – GuM Jan 20 '18 at 01:19
8

Does this befit you?

\documentclass{article}
\usepackage{mathtools, graphicx}

\begin{document}

\begin{align*}
    e^{G(t)} &= e^{\int{\mkern-7mu\frac{t}{1+t^{\scalebox{0.8}{$ \scriptscriptstyle2 $}}} dt}} \\
    &= e^{\frac{1}{2}\ln(1+t^2)} \\
    &= \sqrt{1 + t^2}
\end{align*}

\end{document} 

enter image description here

Bernard
  • 271,350