- #1
MarkFL
Gold Member
MHB
- 13,288
- 12
Until now, I have avoided trying to display techniques of division using $\LaTeX$ because there just didn't seem to be a nice way to carry it out. However, we may use the array environment for the display of synthetic and polynomial long division methods very nicely.
I will demonstrate how to use the array environment to show that:
\(\displaystyle \frac{x^2+2x+1}{x+1}=x+1\)
using the two methods of division commonly taught to algebra students, i.e., synthetic and polynomial long division.
First, let's discuss the array environment. To define an array you may use the tags:
Next, you need to define how many columns there will be and what the alignment of those columns should be. You use "l" for left, "c" for center, and "r" for right. Each row needs to be defined using one of these three characters. By placing the vertical bar character "|" in between two columns in this alignment definition, you can cause a vertical bar to be displayed in the array. Each row in the array is separated by a double backslash "\\" and each element in the rows is separated by an ampersand "&". Data elements may be blank as well.
Synthetic division
The first column may be center-aligned, and then a vertical bar should separate the first column from the others, which should all be right-aligned.
The $\LaTeX$ code:
produces:
\(\displaystyle \begin{array}{c|rrr}&1&2&1\\-1&&-1&-1\\\hline\\&1&1&0\\\end{array}\)
Notice that the \hline command produces a horizontal line.
Polynomial long division
Here we may use just one right-aligned column for our array.
The $\LaTeX$ code:
produces:
\(\displaystyle \begin{array}{r}x+1\\x+1\enclose{longdiv}{x^2+2x+1}\\-\underline{\left(x^2+x\right)}\hspace{1.5em}\\x+1\hspace{.33em}\\-\underline{(x+1)}\\0\hspace{.33em}\\\end{array}\)
The first row contains the quotient, and the second row should be of the form:
divisor\enclose{longdiv}{dividend}
The \underline{expression} command may be used where subtractions are carried out.
Notice that the horizontal space command \hspace{#em} may be used to introduce white space at the end of rows to align the data as needed. You may have to experiment some to get it just right. :D
I will demonstrate how to use the array environment to show that:
\(\displaystyle \frac{x^2+2x+1}{x+1}=x+1\)
using the two methods of division commonly taught to algebra students, i.e., synthetic and polynomial long division.
First, let's discuss the array environment. To define an array you may use the tags:
Code:
\begin{array} and \end{array}
Next, you need to define how many columns there will be and what the alignment of those columns should be. You use "l" for left, "c" for center, and "r" for right. Each row needs to be defined using one of these three characters. By placing the vertical bar character "|" in between two columns in this alignment definition, you can cause a vertical bar to be displayed in the array. Each row in the array is separated by a double backslash "\\" and each element in the rows is separated by an ampersand "&". Data elements may be blank as well.
Synthetic division
The first column may be center-aligned, and then a vertical bar should separate the first column from the others, which should all be right-aligned.
The $\LaTeX$ code:
Code:
\begin{array}{c|rrr}&1&2&1\\-1&&-1&-1\\\hline\\&1&1&0\\\end{array}
produces:
\(\displaystyle \begin{array}{c|rrr}&1&2&1\\-1&&-1&-1\\\hline\\&1&1&0\\\end{array}\)
Notice that the \hline command produces a horizontal line.
Polynomial long division
Here we may use just one right-aligned column for our array.
The $\LaTeX$ code:
Code:
\begin{array}{r}x+1\\x+1\enclose{longdiv}{x^2+2x+1}\\-\underline{\left(x^2+x\right)}\hspace{1.5em}\\x+1\hspace{.33em}\\-\underline{(x+1)}\\0\hspace{.33em}\\\end{array}
produces:
\(\displaystyle \begin{array}{r}x+1\\x+1\enclose{longdiv}{x^2+2x+1}\\-\underline{\left(x^2+x\right)}\hspace{1.5em}\\x+1\hspace{.33em}\\-\underline{(x+1)}\\0\hspace{.33em}\\\end{array}\)
The first row contains the quotient, and the second row should be of the form:
divisor\enclose{longdiv}{dividend}
The \underline{expression} command may be used where subtractions are carried out.
Notice that the horizontal space command \hspace{#em} may be used to introduce white space at the end of rows to align the data as needed. You may have to experiment some to get it just right. :D