[Tex/LaTex] lim within an array

math-mode

I'm having trouble getting lim to work inside an array

Here is my code

 \begin{align*}
   \lim_{e \rightarrow 0}{e^{A_\epsilon}} =
   \left(
     \begin{array}{cc}
       1 & \lim_{e \rightarrow 0}{\frac{e^\epsilon + e^{-\epsilon}}{2}} \\
       0 & 1 \\
     \end{array}
   \right)
   =
   \left(
     \begin{array}{cc}
       1 & 1 \\
       0 & 1 \\
     \end{array}
   \right)
 \end{align*}

My first lim is working correctly, but the second one looks weird. Here is the output of the above code within my larger document:

I'm kind of new to Latex, any help would be appreciated

Best Answer

In addition to the point made by @PrzemysławScherwentl in his answer -- use \displaystyle on the upper-right element of the first matrix -- and implementing his suggestion that \epsilon rather than e should be the variable whose limit is 0, I would also recommend you use a \pmatrix environment instead of \left(\begin{array{cc} ... \end{array}\right). You'll get less-profligate spacing that way.

Oh, and since the expression fits on a single line, I wouldn't use an align* environment. Instead, you should use an equation* environment.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for pmatrix and equation* environments
\begin{document}
\begin{equation*}
\lim_{\epsilon \rightarrow 0}{e^{A_\epsilon}} =
     \begin{pmatrix}
       1 & \displaystyle \lim_{\epsilon \rightarrow 0}{\frac{e^{\epsilon} + e^{-\epsilon}}{2}} \\[1.5ex]
       0 & 1 \hfill \\
     \end{pmatrix}   =
     \begin{pmatrix}
       1 & 1 \\
       0 & 1 \\
     \end{pmatrix}
\end{equation*}
\end{document}