# Aligning two equations (one split and another non-split)

I have the below two equations,

\begin{eqnarray}
\begin{split}
C_{N+1} &= h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  + \left[ h\left( X_{N+1}; \phi_{N+1} \right) - h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  \right] \\
& + u^{g}_{N+1} + u^{r}_{N+1}
\end{split}
\end{eqnarray}
\begin{eqnarray}
C_{N+1} &= h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  + u^{\phi}_{N+1}  + u^{g}_{N+1} + u^{r}_{N+1}
\end{eqnarray}


which gets displayed as below:

How could I align both these equations at the = sign ?

What I intend to do is :

You don't really want to align the + sign with the = sign.

You can use split, but don't ever use eqnarray.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
\begin{split}
C_{N+1} &= h( X_{N+1}; \hat{\phi}_{N+1} )  + [ h( X_{N+1}; \phi_{N+1} ) - h( X_{N+1}; \hat{\phi}_{N+1} ) ] \\
\end{split}
\\[1ex]
C_{N+1} &= h( X_{N+1}; \hat{\phi}_{N+1} )  + u^{\phi}_{N+1}  + u^{g}_{N+1} + u^{r}_{N+1}
\end{align}

\end{document}


I removed all \left and \right commands and you can see that the formulas have become more readable.

The align package works without the eqnarray package! Solution as follows:

\begin{align}
C_{N+1} &= h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  + \left[ h\left( X_{N+1}; \phi_{N+1} \right) - h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  \right] \nonumber \\
& + u^{g}_{N+1} + u^{r}_{N+1} \\
C_{N+1} &= h\left( X_{N+1}; \hat{\phi}_{N+1} \right)  + u^{\phi}_{N+1}  + u^{g}_{N+1} + u^{r}_{N+1}
\end{align}


• It is also common to use &\phantom{=}
– Werner
Commented Jan 27, 2022 at 4:33