I'm attempting to create step-by-step solution for finding the factors of a polynomial using synthetic division. The code for creating the synthetic division layout is courtesy of David Carlisle and renders this:
The synthetic division uses \usepackage{nicematrix}
With {NiceArray}
of nicematrix
. (h/t F. Pantigny)
I think the array would be more readable with slight increase in the horizontal line spacing between rows. But I've already done too much damage to the code.
The code won't render the synthetic division array shown above or anything else past the header. Note: I used $
in some lines only to highlight that those lines should be display math.
Additionally, this error in the log:
The image below shows what I'm attempting to create for my students:
The code makes a 2 column horizontally enumerated layout. So probably the solution steps should be stacked vertically to save horizontal space and allow for 2 problems -- 1 each per column.
I realize that this is a huge ask for you the reader. But both my students and I will truly appreciate your assistance! Many thanks!
mwe
\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{framed} %box para
\usepackage{multicol}
%David Carlisle code for synthetic division follows
\usepackage{multirow}
\usepackage{dcolumn}
\newcolumntype{2}{D{.}{}{2.0}}
\usepackage{tasks}
\usepackage{xcolor}
\usepackage[margin=0.5in]{geometry}
%\usepackage{bm}%bold equation
\setlength{\parindent}{0pt} % removes paragraph indentation
\pagestyle{head}
\header{Algebra II: Assignment: 10-D Extension Factoring Polynomial Equations}
{}
{Due 03/17/2023}
\newcommand{\pagetop}{%
\vspace{4mm}
\fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
\textbf {Use the give factor and synthetic division to find all factors of each polynomial.}
}}}\par
\vspace{0.5mm}
}
\setlength{\jot}{1em}
%define highlighting
\newcommand{\hll}[1]{\colorbox{yellow}{$\displaystyle #1$}}
%define minipage for x y table
\newenvironment{MyMinipage}[2][t]{%
\begin{minipage}[#1][0.5\textheight]{0.47\linewidth}\centering%
\SetTikzMarkPrefix{#2}%
}{%
\end{minipage}%
}%
\begin{document}
\pagetop
\settasks{
after-item-skip=3em, after-skip=2cm,
label-width=2em,
item-indent=3em,
label=(\arabic*),
column-sep=2em
}
\begin{tasks}(2)
% Problem 1:
factor: [\(x+3);5x^3+18x^2+7x-6
\renewcommand\arraystretch{1.5}
\setlength\doublerulesep{0pt}
%text Use synthetic division for 1st factoring step.
\begin{array}{rrrrr}
\multicolumn{1}{r|}{-\frac{4}{3}} & {3} & -1 & -6 & 12\\\cline{2-5}
& & -4& \frac{20}{3} & -\frac{8}{9}\\\cline{2-5}
& 3 & -5& \frac{2}{3} & \frac{100}{9}
\end{array}
%text Factor $5x^2+3x-2$
$a\cdot c = -10$
%text: list factors of $-10$
\begin{MyMinipage}
{Quadrant2}
$\begin{array}{c | c }
\multicolumn{2}{c}{-10} \\
\toprule
-1& 10 \\
-2 & 5 \\
1 & -10 \\
2 & -5\\
\bottomrule
\end{array}$\par
\end{MyMinipage}%
(5x^2-2x)+(5x-2)\\
x(5x-2)+1(5x-2)\\
(x+1)(5x-2)(x+3)
\]
% Problem #2
\task
\end{tasks}
\end{document}