# Align multi lines equations

I have two questions.

First: How can I align to the left all S?

Second: How to make the second line of each S be aligned with the first and not centered as it is.

$$\begin{gathered}\label{eq:suav2} S_0^+ = \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]^2 + 1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]^2 + \\ 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]^2 \\ S_1^+ = \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]^2 + 1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + \\ 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]^2 \\ S_2^+ = \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]^2 + 1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + \\ 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]^2 \\ S_3^+ = \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]^2 + 1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]^2 + \\ 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]^2 \end{gathered}$$


Use aligned instead of gathered:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{aligned} S_0^+ ={}& \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]^2 + 1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]^2 + {} \\ & 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]^2 \\ S_1^+ ={}& \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]^2 + 1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + {} \\ & 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]^2 \\ S_2^+ ={}& \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]^2 + 1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + {} \\ & 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]^2 \\ S_3^+ ={}& \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]^2 + 1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]^2 + {} \\ & 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]^2 \end{aligned}

\end{document}


For ease of use I've used ={}& instead of &=... the more traditional way of aligning around the relation.

• @Werner: Perhaps + {} \\  rather than + \\  at the end of the first lines? – Bernard Oct 4 '17 at 19:09

I suggest two other variants:

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath}

\begin{document}

\raisetag{2cm} \begin{aligned} S₀^+ & = \begin{aligned}[t] \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]² & + 1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]² \\[-0.7ex] & + 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]² \end{aligned} \\ S₁^+ & = \begin{aligned}[t] \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]² & + 1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex] & + 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]² \end{aligned} \\ S₂^+ & = \begin{aligned}[t] \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]² & + 1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex] & + 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]² \end{aligned} \\ S₃^+ & = \begin{aligned}[t] \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]² & + 1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]² \\[-0.7ex] & + 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]² \end{aligned} \end{aligned}
\vspace{1cm}
\begin{aligned} S₀^+ & = \begin{aligned}[t] \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]² + 1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]² \\[-0.7ex] {} + 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]² \end{aligned} \\ S₁^+ & = \begin{aligned}[t] \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]² + 1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex] {} + 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]² \end{aligned} \\ S₂^+ & = \begin{aligned}[t] \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]² + 1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex] {} + 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]² \end{aligned} \\ S₃^+ & = \begin{aligned}[t] \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]² + 1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]² \\[-0.7ex] {} + 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]² \end{aligned} \end{aligned}

\end{document}