# Equations with several identities

I want to write a simple single line equation of this kind: a = b + c = d + e + f. However, when I try to add the second identity ( = ), everything on its right side does not appear in the results. Following a piece of code here I used the &= for either the second identity or both the first and the second. Still I am doing something wrong. Here follows the code I am trying to use

$$\hat{{\varphi}_{it} (i_{it}, k_{it})} &= \hat{y_{it}} - \hat{{\beta}_{l}} l_{it} - \hat{{\vartheta}_{1}} X_{it} - \hat{{\vartheta}_{2}} Z_{it} &= \hat{{delta_{0}} + \sum{\sum{{\delta}_{ij} k_{t}^{i} i_{t}^{j}}} - \hat{{\beta}_{l}}l_{it} - \hat{{\vartheta}_{1}} X_{it} - \hat{{\vartheta}_{2}} Z_{it}$$


I get the 3 following error messages exactly, attributed to the line after the command :

 Paragraph ended before \mathaccent\/ was complete
Missing $inserted Display math should end with$\$

• Welcome to TeX.sx! Please try to give the minimal working example (MWE) in which your problem occurs. Creating it is the first step in debugging and helps us tremendously in pin-pointing where the issue may lie. In particular it should start with \documentclass and end with \end{document}.
– bodo
Feb 25 '14 at 11:55
• remove the & (equation is not an alignment environment) Feb 25 '14 at 12:04
• Suggestion: when you have a long equation to write, do it a little bit at a time and compile each time. Then it will be easier to locate errors. Feb 25 '14 at 13:10

Is this what you try to obtain? The first approach is a pure/simple math environment, the second is use of array environment, and the third approach is use of align environment. This solution simplifies the code.

Note: There was an extra \hat on the second equation right after = without an ending } and was removed. Also a backslash was missing for delta in the second equation.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

% -- case 1

$$%\begin{array}{lll} \hat{\varphi}_{it} (i_{it}, k_{it}) =\hat{y}_{it} - \hat{\beta_l} l_{it} - \hat{\vartheta}_1 X_{it} - \hat{\vartheta}_2 Z_{it} \\ = \delta_0+ \sum{\sum{\delta_{ij} k_{t}^{i} i_{t}^{j}}} - \hat{\beta_l} l_{it} - \hat{\vartheta}_{1} X_{it} - \hat{\vartheta}_{2} Z_{it} %\end{array}$$
\vspace{1cm}

% -- case 2

$$\begin{array}{lll} \hat{\varphi}_{it} (i_{it}, k_{it}) &=\hat{y}_{it} - \hat{\beta_l} l_{it} - \hat{\vartheta}_1 X_{it} - \hat{\vartheta}_2 Z_{it} \\ &= \delta_0+ \sum{\sum{\delta_{ij} k_{t}^{i} i_{t}^{j}}} - \hat{\beta_l} l_{it} - \hat{\vartheta}_{1} X_{it} - \hat{\vartheta}_{2} Z_{it} \end{array}$$
\vspace{1cm}

% --- case 3

\begin{aligned} \hat{\varphi}_{it} (i_{it}, k_{it}) &= \hat{y}_{it} - \hat{\beta_l} l_{it} - \hat{\vartheta}_1 X_{it} - \hat{\vartheta}_2 Z_{it} \\ &= \delta_0+ \sum{\sum{\delta_{ij} k_{t}^{i} i_{t}^{j}}} - \hat{\beta_l} l_{it} - \hat{\vartheta}_{1} X_{it} - \hat{\vartheta}_{2} Z_{it} \end{aligned}

\end{document}

• Ok thanks. What am I instead supposed to do if I want to put everything on the same line ?
– Bob
Feb 25 '14 at 12:42
• OK just remove the \\ on the first line and remove the second &. You will get a one line equation. But it may exceed the text width. Feb 25 '14 at 12:44
• Of course you could remove the array environment in the first case, for example, and all the & out of the equation and still get a one line equation. Feb 25 '14 at 12:48
• Yes, in equation environment & does not work and shows error. But the \\ (if any) does not work either, all will continue to be typeset. Feb 25 '14 at 13:01