# System of equation left aligned

There is a system of equation.
How to align it on the left? (second line should be started right under the first line)

My code of this:

\left\{\begin{aligned} \hat a \sum x^2_i + \hat b \sum x_i = \sum x_i \cdot y_i,\\ \hat a \sum x_i + n \cdot \hat b =\sum y_i.\\ \end{aligned} \right.

• Put the & character before the first \hat at each line and remove the \$ symbols. – wipet Dec 13 '14 at 21:49

Just use the cases environment:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}

\begin{document}

$$\begin{dcases} \hat a \sum x^2_i + \hat b \sum x_i = \sum x_i \cdot y_i,\\ \hat a \sum x_i + n \cdot \hat b =\sum y_i. \end{dcases}$$

\end{document}


• It work properly, but now it system looks smaller than another text. Look at the screenshot s27.postimg.org/rboabhkyb/…. (equation number 5 uses cases). How fix it? – 0x1337 Dec 13 '14 at 22:06
• @0x1337 Load mathtools instead of amsmath and use dcases. – Manuel Dec 13 '14 at 22:18
• @Manuel: forgot that size inside cases is like inside array. Corrected. – Bernard Dec 13 '14 at 22:39
• @Ox1337: Manuel gave the fix. See my updated answer. Don't load amsmath in that case, since mathtools does it for you (as a rule of thumb, one should load mathtools rather than amsmath). – Bernard Dec 13 '14 at 22:41

Use the & symbol before each expression. For example to align:

\begin {aligned}
\sum^{n}_{i=1} K=0\\
a^2+b+c=0\longrightarrow\Psi
\end{aligned}


Which is:

Use & at the beginning to align them left:

\begin {aligned}
&\sum^{n}_{i=1} K=0\\
&a^2+b+c=0\longrightarrow\Psi
\end{aligned}


And obtain:

Or use it before whathever you want, for example before the = to align them:

\begin {aligned}
\sum^{n}_{i=1} K&=0\\
a^2+b+c&=0\longrightarrow\Psi
\end{aligned}


Giving:

• The term "before each expression" is not unambiguous since you haven't made clear what you mean by expression. Using an expression [!] such as "at the start of both rows" would be clearer. Better yet, just post a code example that incorporates your suggestion, and all guesswork is eliminated. – Mico Dec 13 '14 at 23:54
• You're right, I'll edit. – Renijk Dec 14 '14 at 12:07