[Tex/LaTex] problem of introducing long brackets in different lines

brackets

I have a problem writing an equation in eqnarray environment, where I split a single line into two lines. The first line starting with \left[ and the second line ending with \right], but I could not compile it using latex.

You should use align instead ofeqnarray as per this question that compares eqnarray vs align, and Stefan Kottwitz blong entry: \eqnarray vs \align environment.

Here is an example of using the \right., and \left. pair to complete the matching pair using the align environment. Note that the size of the brackets is not the same in the first example. This is due to the fact that the \left. [itex] \right] of the second line does not see the vertical spacing of the \left[ [itex] \right. that the first line does. To fix that you need to add a \vphantom{} with the term which has the largest vertical spacing in the first line. This yields the second result:

\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
\begin{align*}
y &= \left[\frac{1}{2}\right. \\