Math Mode – Construct Long Equation Split in LHS and RHS

math-mode

I have a homework document using 2-column article document class as follows.

\documentclass[twocolumn]{article}
\usepackage[a4paper,margin=1cm]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
    \item The degree of (C) is 3.
    \item The degree of (A) is 1.
    \item
    $
    \begin{aligned}[t]
        \begin{split}
        -3x(x+1)&-2x(x-1) \\
                        &+4(x^2-3x-1)   
        \end{split}
            &= 
        \begin{split}
        -3x^2&-3x-2x^2+2x\\
                 &+4x^2-12x-4   
        \end{split}\\
            &= -x^2-13x-4       
    \end{aligned}
    $
\end{enumerate}
\end{document}

What I want to achieve are:

  • the long equation is split in both LHS and RHS.
  • the = is consistently aligned.

The output I want to achieve roughly looks like the following "screenshot".

enter image description here

The red lines represent the first two items and the green one represents the long equation. The black line represents the hypothetical column separator.

How to construct a long equation that is split in LHS and RHS to occupy a narrow column?

Best Answer

This is based on mafp's answer, but doesn't use aligned in the left. Note the \! in front of \begin{aligned} and the {}+, which are needed for proper spacing!

output

\documentclass[twocolumn]{article}
\usepackage[a4paper,margin=1cm]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}
    \item The degree of (C) is 3.
    \item The degree of (A) is 1.
    \item%
    $
    \!\begin{aligned}[t]
      -3x(x+1)-2x(x-1) \\
        {}+4(x^2-3x-1) &= \!\begin{aligned}[t]
                          -3x^2-3x-2x^2+2x \\
                          {}+4x^2-12x-4
                          \end{aligned} \\
                       &= -x^2-13x-4
    \end{aligned}
    $
\end{enumerate}
\end{document}