# I'm having problem in writing one long equation into multiple line with bracket

This block of code gives me an error when compiled.

\begin{aligned} MSE\left(\mu_r\right)={} &\bar{Y}^2\left[\ {f_1}\left\lbrace C_Y^2+\frac{C_X}{\theta}_X{a_h^2}(1)+2\rho_{XY}C_XC_Ya_h(1)\right\rbrace\\ &+\theta\left\lbrace\frac{C_{Y(2)}^2}{\theta}_{Y(2)}+\frac{C_{X(2)}^2}{\theta}_{X(2)}a_h^{*2}(1)+2\rho_{XY(2)}C_{X(2)}C_{Y(2)}a^*_{h(1)}\right\rbrace\right] \end{aligned}


• Welcome to TeX.SE. – Mico Mar 25 at 21:36

The main issue is that TeX and LaTeX do not allow \left[/\right] pairs to span a line break. Use \biggl[ and \biggr] instead. And, to assure that the curly braces have the same size as the square brackets, use \biggl\lbrace and \biggr\rbrace in both rows.

I would further like to suggest that you employ a multline environment instead of an equation/aligned pair. This will assure that the material in the second row will fit within the textblock.

\documentclass{article}
\usepackage{amsmath} % for 'multline' environment
\begin{document}
\begin{multline}
\mathrm{MSE}(\mu_r)
=\bar{Y}^2\biggl[ f_1 \biggl\lbrace
C_Y^2+ \frac{C_X}{\theta}_X a_h^2(1)
+2\rho_{XY} C_X C_Y a_h(1)
\biggr\rbrace \\[1ex]
+\theta \biggl\lbrace
\frac{C_{Y(2)}^2}{\theta}_{Y(2)}
+\frac{C_{X(2)}^2}{\theta}_{X(2)} a_h^{*2}(1)
+2\rho_{XY(2)}C_{X(2)}C_{Y(2)}a^*_{h(1)}
\biggr\rbrace \biggr]
\end{multline}
\end{document}