求解同一条直线上的线性方程组

求解同一条直线上的线性方程组

我想让这个看起来更好。当我取消一些变量时,效果并不好。我不想在 E1 + E2 和其他变量下面画一条线。我的一些变量没有对齐。我该如何修复这些细节?

\documentclass[10pt]{article}
\usepackage{enumitem}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{multicol}
\usepackage{color}
\usepackage[makeroom]{cancel}
\usepackage{booktabs}

\topmargin -3cm
\oddsidemargin -2cm
\evensidemargin -2cm
\textheight 10in
\textwidth 8in

\begin{document}
\begin{enumerate}

\item[34.] Solve the system using elimination by addition.

\begin{align*}
x+y+z &= 0 \ \ E_{1} && \\
-x+y-2z &= 6 \ \ E_{2} && \\
2x+y+z &= 0 \ \ E_{3}
\end{align*}

\begin{multicols}{3}

\begin{minipage}[t]{0.25\textwidth}
Begin by adding two equations. We can see that the $x$'s cancel out:
\begin{equation*}
\begin{split}
E_1+E_2: {\cancel{x}} + y +z &= 0 \\
{\cancel{-x}} +y -2z &= 6  \\
\midrule
2y-z &= 6 \ \ E_{4} 
\end{split}
\end{equation*}
\end{minipage}
\hspace{\fill}

\begin{minipage}[t]{0.25\textwidth}
    Since we canceled the $x$'s in the first set we must cancel the $x$ in the second:
\begin{equation*}
\begin{split}
E_2+E_3: {\color{red}2(}-x +y -2z {\color{red})} &= 6 \\
2x + y + z &= 0  \\
\midrule
\cancel{-2x}+ 2y-4z &= 12 \\
\cancel{2x} + y +z &= 0 \\
\midrule
3y-3z &= 12 \ \ E_5
\end{split}
\end{equation*}
\end{minipage}
\hspace{\fill}

\begin{minipage}[t]{0.25\textwidth}
    We must cancel out one of the variables. It will be easier to cancel out $z$.
\begin{equation*}
\begin{split}
E_4 + E_5: {\color{red}-3(}2y-z &= 6 {\color{red})} \\
3y-3z &= 12 \\
\midrule
-6y \cancel{+3z} &= -18 \\
3y \cancel{-3z} &= 12 \\
\midrule
-3y &= -6 \\
y &= 2
\end{split}
\end{equation*}
\end{minipage}

    \end{multicols}

    \begin{multicols}{2}
    \begin{minipage}[t]{0.30\textwidth}
Substitute $y=2$ into either $E_4$ or $E_5$ to find $z$.
\begin{equation*}
\begin{split}
E_4: 2y-z &= 6 \\
2(2)-z &= 6 \\
4-z &= 6 \\
z &= -2
\end{split}
\end{equation*}
    \end{minipage}
    \hspace{\fill}  

    \begin{minipage}[t]{0.30\textwidth}
Substitute $y=2$ and $z=-2$ into either $E_1$, $E_2$, or $E_3$ to find $x$.
\begin{equation*}
\begin{split}
E_1: x + y + z &= 0 \\
x + 2 + -2 &= 0 \\
x &= 0
\end{split}
\end{equation*}
    \end{minipage}
     \end{multicols}

    Thus, our answer is C. $(0,2,-2)$.
    \end{enumerate}
    \end{document}

答案1

这是一个使用并排minipage环境但没有multicols环境的解决方案。由于小页面非常窄,我建议您使用右对齐而不是完全对齐;这可以通过使用ragged2e选项加载包来实现document。要对齐方程中的变量,请使用\phantom与前两个方程中使用的语句类似的语句。

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{enumitem}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{color}
\usepackage[makeroom]{cancel}
\usepackage{booktabs}

\usepackage[a4paper,margin=1cm]{geometry}
\usepackage[document]{ragged2e}

\begin{document}

\begin{enumerate}
\item[34.] Solve the system using elimination by addition.

\[ \begin{split}
 x+y+\phantom{1}z &= 0 \quad E_{1} \\
-x+y-2z &= 6 \quad E_{2}\\
2x+y+\phantom{1}z &= 0 \quad E_{3}
\end{split} \]


\vspace{0.5cm} % add vertical whitespace

\begin{minipage}[t]{0.3\linewidth}
Begin by adding two equations. We can see that the $x$'s cancel out:
\[ \begin{split}
E_1+E_2: {\cancel{x}} + y +\phantom{1}z &= 0 \\
         {\cancel{-x}} +y -2z &= 6  \\
\midrule
         2y-z &= 6 \quad E_{4} 
\end{split} \]
\end{minipage}
\hspace{\fill}
\begin{minipage}[t]{0.3\linewidth}
Since we canceled the $x$'s in the first set we must cancel the $x$ in the second:
\[ \begin{split}
E_2+E_3: {\color{red}2(}{-}x +y -2z &= 6 {\color{red})}\\
2x + y + z &= 0  \\
\midrule
\cancel{-2x}+ 2y-4z &= 12 \\
 \cancel{2x}+  y+ z &= 0 \\
\midrule
              3y-3z &= 12 \quad E_5
\end{split} \]
\end{minipage}
\hspace{\fill}
\begin{minipage}[t]{0.3\linewidth}
We must cancel out one of the remaining variables. It will be easier to cancel out~$z$.
\[ \begin{split}
E_4 + E_5: {\color{red}-3(}2y-z &= 6 {\color{red})} \\
            3y-3z &= 12 \\
\midrule
-6y \cancel{+3z} &= -18 \\
 3y \cancel{-3z} &= 12 \\
\midrule
-3y &= -6 \\
  y &= 2
\end{split} \]
\end{minipage}


\vspace{1cm}% add vertical whitespace

\begin{minipage}[t]{0.30\linewidth}
Substitute $y=2$ into either $E_4$ or~$E_5$ to find~$z$.
\[ \begin{split}
E_4: 2y-z &= 6 \\
     2(2)-z &= 6 \\
     4-z &= 6 \\
     z &= -2
\end{split} \]
\end{minipage}%
\hspace{0.05\linewidth}%
\begin{minipage}[t]{0.30\linewidth}
Substitute $y=2$ and $z=-2$ into either $E_1$, $E_2$, or $E_3$ to find~$x$.
\[ \begin{split}
E_1: x + y + z &= 0 \\
     x + 2 + -2 &= 0 \\
     x &= 0
\end{split} \]
\end{minipage}

\vspace{1cm} % add vertical whitespace

Thus, our answer is C. $(0,2,-2)$.
\end{enumerate}
\end{document}

答案2

从视觉上看,这可能不是理想的,但却解决了您的担忧:

在此处输入图片描述

\documentclass{article}

\usepackage{amsmath,eqparbox}
\usepackage{xcolor,booktabs,tabularx}
\usepackage[makeroom]{cancel}
\usepackage[margin=1cm]{geometry}

\begin{document}

\begin{enumerate}

  \item[34.] Solve the system using elimination by addition.
  \begin{alignat*}{3}
     x + y +  z &= 0 \qquad && E_1 \\
    -x + y - 2z &= 6        && E_2 \\
    2x + y +  z &= 0        && E_3
  \end{alignat*}

  \begin{tabularx}{\linewidth}{@{} X X X @{}}
    Begin by adding two equations. We can see that the~$x$'s cancel out: &
    Since we canceled the~$x$'s in the first set we must cancel the~$x$ in the second: &
    We must cancel out one of the variables. It will be easier to cancel out~$z$: \\

    {$\begin{array}[t]{ r r l }
      E_1 + E_2: & \cancel{ x} + y +  z = 0 \\
                 & \cancel{-x} + y - 2z = 6 \\
      \cmidrule{2-2}
                   &            2y -  z = 6 & E_4
    \end{array}$} &
    {$\begin{array}[t]{ r r l }
      E_2 + E_3: & {\color{red}2(} -x  +  y - 2z {\color{red})} = \eqmakebox[R1][r]{$6$} \\
                   &               2x  +  y +  z                = \eqmakebox[R1][r]{$0$} \\
      \cmidrule{2-2}
                   &      \cancel{-2x} + 2y - 4z = \eqmakebox[R1][r]{$12$} \\
                   &      \cancel{ 2x} +  y +  z = \eqmakebox[R1][r]{$0$} \\
      \cmidrule{2-2}
                   &                     3y - 3z = \eqmakebox[R1][r]{$12$} & E_5
    \end{array}$} &
    {$\begin{array}[t]{ r r l }
      E_4 + E_5: & {\color{red}-3(}2y -  z = \eqmakebox[R2][r]{$6 \rlap{\color{red})}$} \\
                 &                 3y - 3z = \eqmakebox[R2][r]{$12$} \\
      \cmidrule{2-2}
                   &              -6y \cancel{+ 3z} = \eqmakebox[R2][r]{$-18$} \\
                   &               3y \cancel{- 3z} = \eqmakebox[R2][r]{$12$} \\
      \cmidrule{2-2}
                   &              -3y = \eqmakebox[R2][r]{$-6$} \\
                   &                y = \eqmakebox[R2][r]{$2$}
    \end{array}$}
  \end{tabularx}

  \begin{tabularx}{\linewidth}{ X X }
    Substitute $y = 2$ into either~$E_4$ or~$E_5$ to find~$z$: &
    Substitute $y = 2$ and $z = -2$ into either~$E_1$,~$E_2$, or~$E_3$ to find~$x$: \\
    {$\begin{array}[t]{ r r }
      E_4: &  2y  - z = \eqmakebox[R3][r]{$6$} \\
           & 2(2) - z = \eqmakebox[R3][r]{$6$} \\
           &   4  - z = \eqmakebox[R3][r]{$6$} \\
           &        z = \eqmakebox[R3][r]{$-2$}
    \end{array}$} &
    {$\begin{array}[t]{ r r }
      E_1: & x + y +  z = 0 \\
           & x + 2 + -2 = 0 \\
           & x          = 0
    \end{array}$}
  \end{tabularx}

  Thus, our answer is~C. $(0,2,-2)$.
\end{enumerate}

\end{document}

相关内容