How do I to replicate this system of equations?

You can align the first four equations, i.e. the equations of the problem, automagically with systeme. I would add the restrictions separately.

\documentclass[fleqn]{article}
\usepackage{systeme}
\begin{document}
\[\sysdelim..
\systeme{x_1+x_5-3x_6-4x_7+2x_8=5,
x_2+3x_5+7x_6+2x_7-2x_8=6,
x_3-4x_5-2x_6-7x_7-2x_8=2,
x_4-3x_5+4x_6+3x_7+3x_8=1}\]
where $x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8\ge 0$.
\end{document}

enter image description here


If you wish to stick to align-like environments, you can use alignat:

enter image description here

\documentclass{article}

\usepackage{mathtools}
\newcommand{\Pz}{\phantom{0}}

\begin{document}

\begin{alignat*}{4}
%  R     L     R     L      R                       L         R   L   
  x_1 &     &     &     &{} + \Pz x_5 & - 3x_6 - 4x_7 + 2x_8 & &= 5 \\
      & x_2 &     &     &{} +    3x_5 & + 7x_6 + 2x_7 - 2x_8 & &= 6 \\
      &     & x_3 &     &{} -    4x_5 & - 2x_6 - 7x_7 - 2x_8 & &= 2 \\
      &     &     & x_4 &{} -    3x_5 & + 4x_6 + 3x_7 + 3x_8 & &= 1 \\
      &     &     &     &             &                      &
            \mathllap{x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8}  &\geq 0
\end{alignat*}

\end{document}

Above is an additional line showing the alignments for each column within the 4-set of Right/Left alignments.

Tags:

Align