# Box and Give Equation Number to a multiline mathematical equation

$I(a_1,a_2,a_3)=\displaystyle{\int\limits_{c_1-i\infty}^{c_1+i\infty}\mathrm{\frac{dz_1}{2\pi i}}\, \, \cdots\int\limits_{c_5-i\infty}^{c_5+i\infty}\mathrm{\frac{dz_5}{2\pi i}}(Q^2)^{z_1}(M^2)^{z_2} \left\langle a_1+z_3 \right\rangle \left\langle a_2+z_{14} \right\rangle \left\langle a_3+z_{125} \right\rangle \left\langle d/2+z_{1345} \right\rangle}$
\begin{flushright}
$\displaystyle{\cdot\frac{\Gamma(-z_1) \Gamma(-z_2)\Gamma(-z_3)}{\Gamma(a_1)\Gamma(a_2)\Gamma(z_1+d/2)}}$\\
\end{flushright}

• please extend your code fragment to complete but small document beginning with \documentclas{...} and ending with \end{document}. preamble should contain only to your problem relevant packages. explain, where you like to have box? welcome to tex.se! Jun 18, 2018 at 5:41
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Aug 20, 2019 at 4:53

• Do familiarize yourself with the amsmath package and, in particular, the multiline displayed-equation environments provided by this package. For your equation, I'd like to suggest a split environment embedded in an equation environment. The equation environment provides the equation number, and the split environment lets you introduce line splits and provide alignment points.

• Don't overuse \left, \right, and \limits. In fact, these directives are not needed here if you set up the correct math environments.

• Unless the textblock of your environment is unusually wide, it's necessary to make the equation span three rows, not just two.

• Use the \boxed macro, also provided by the amsmath package, to draw a rectangular box around the equation.

\documentclass{article}
\usepackage{amsmath} % for "\boxed" macro and "split" env.
\begin{document}
$$\boxed{% \begin{split} I(a_1,a_2,a_3) &=\int_{c_1-i\infty}^{c_1+i\infty}\frac{\mathrm{d}z_1}{2\pi i} \,\dotsi \int_{c_5-i\infty}^{c_5+i\infty}\frac{\mathrm{d}z_5}{2\pi i} \times(Q^2{)}^{z_1}(M^2{)}^{z_2}\\ &\quad\times \langle a_1+z_3 \rangle \langle a_2+z_{14} \rangle \langle a_3+z_{125} \rangle \langle d/2+z_{1345}\rangle \\ &\quad\times\frac{\Gamma(-z_1)\Gamma(-z_2)\Gamma(-z_3)}{ \Gamma(a_1)\Gamma(a_2)\Gamma(z_1+d/2)} \end{split} } % end of \boxed$$
\end{document}