# How to make a box for more than one equation using eqnarray?

I have tried to make a box for one equation only, but I confused to make a box for more than one equation without changing the position of my equation. This is my code,

\begin{eqnarray}
C_n(t) = \delta_{n,i}&-&\frac{i}{\hbar}\int_{-\infty}^{t} d\tau \bra{\psi_n}H_1(\tau)\ket{\psi_i}\exp(i\omega_{ni}t) \nonumber\\
&+& {\Big(-\frac{i}{\hbar}\Big)}^2\int_{-\infty}^{t} d\tau \int_{-\infty}^{\tau} d\tau' \sum_{m} \Big[V_{nm}(\tau')V_{mi}(\tau)\Big]\nonumber\\
&+& {\Big(-\frac{i}{\hbar}\Big)}^3\int_{-\infty}^{t} d\tau \int_{-\infty}^{\tau} d\tau'\int_{-\infty}^{\tau'} d\tau'' \sum_{m,k} \Big[V_{nm}(\tau'')V_{mi}(\tau')V_{ki}(\tau)\Big]\nonumber\\
&+& \dots \nonumber
\end{eqnarray}


you can use the \boxed and aligned facilities of amsmath to get the result you describe:

\documentclass{article}
\usepackage{amsmath}
\usepackage{braket}
\begin{document}
\thispagestyle{empty}
\boxed{ \begin{aligned} C_n(t) = \delta_{n,i}&-\frac{i}{\hbar}\int_{-\infty}^{t} d\tau \bra{\psi_n}H_1(\tau)\ket{\psi_i}\exp(i\omega_{ni}t) \nonumber\\ &+ {\Big(-\frac{i}{\hbar}\Big)}^2\int_{-\infty}^{t} d\tau \int_{-\infty}^{\tau} d\tau' \sum_{m} \Big[V_{nm}(\tau')V_{mi}(\tau)\Big]\nonumber\\ &+ {\Big(-\frac{i}{\hbar}\Big)}^3\int_{-\infty}^{t} d\tau \int_{-\infty}^{\tau} d\tau'\int_{-\infty}^{\tau'} d\tau'' \sum_{m,k} \Big[V_{nm}(\tau'')V_{mi}(\tau')V_{ki}(\tau)\Big]\\ &+ \dots \end{aligned} }
\end{document}


• Thanks @barbara for the answer. What about giving the text with a box in the above left? what should I do for adding that code? – Air.api Dec 14 '16 at 14:24
• not sure what you mean by "the above left". do you mean the portion of the code preceding the first minus sign? – barbara beeton Dec 14 '16 at 14:30
• I mean making a small box in the top left corner of the big box. – Air.api Dec 14 '16 at 14:43
• @Air.api You mean something like the boxes shown here? – sodd Dec 14 '16 at 16:21
• @Air.api The code is too long? The code for defining such a new type of box in the question I linked is actually rather short. And it's not easy to do such thing "using a little command in latex without making a new command". You only have to type the "long" definition of the box once (place it in the preamble), then you can use it several times later without typing everything again, i.e. with a little command. – sodd Dec 15 '16 at 8:03