Synthetic and polynomial long division

In summary, MathJax does not support LaTeX style files. However, it does support defining new macros.
  • #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:

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
 
Physics news on Phys.org
  • #2
For writing \(\LaTeX\) documents, there are two options for division of numbers and \(\LaTeX\) does the math for you as well. These options are
Code:
\input{longdiv}
\usepackage{xlop} %  Be warned French division style
For polynomial divison, we have the following
Code:
\usepackage{polynom}
mg7H8UD.png

Code:
\documentclass{article}
\input{longdiv}
\usepackage{subcaption}
\usepackage{xlop}% http://www.ctan.org/pkg/xlop
\usepackage{polynom}% http://www.ctan.org/pkg/polynom
\begin{document}
\begin{figure}
  \subcaptionbox{}{\longdiv{15}{3}}
  \qquad
  \subcaptionbox{}{\longdiv{17}{3}}
  \qquad
  \subcaptionbox{}{\opdiv{15}{3}}
  \qquad
  \subcaptionbox{}{\opdiv{17}{3}}
\end{figure}

\begin{figure}
  \subcaptionbox{Style A}{\polylongdiv[style = A]{x^2 + 2x + 1}{x + 1}}
  \qquad
  \subcaptionbox{Style B}{\polylongdiv[style = B]{x^2 + 2x + 1}{x + 1}}\\
  \subcaptionbox{Style C}{\polylongdiv[style = C]{x^2 + 2x + 1}{x + 1}}
\end{figure}

\begin{figure}
  \polyhornerscheme[x = 1]{x^2 + 2x + 1}
\end{figure}
\end{document}
If MHB will (or can) load these packages, we would have these abilities within Math Jax
 
  • #3
I quote some information I found online:

MathJax does not support either the \documentclass or \usepackage macros, so strictly speaking, MathJax does not support LaTeX style files. Usually in LaTeX, style files are used to establish document-level formatting (as in the LaTeX article and letter styles), which MathJax simply does not do -- that is handled by HTML. There are a few other common style file tricks that MathJax does not support, like catcodes.

MathJax does support defining new macros, though, either with \newcommand (within a MathJax LaTeX block) or in the Macros section of the MathJax configuration (which requires some JavaScript).

So, it would seem that such functionality would have to be coded by us. Now, I certainly can't make any guarantees at this stage, but it will be something I will be looking into for the future of MHB and our implementation of MathJax.
 

Related to Synthetic and polynomial long division

1. What is synthetic division and when is it used?

Synthetic division is a method used to perform long division of polynomials. It is used when dividing a polynomial by a linear expression of the form (x - a).

2. How does synthetic division differ from traditional long division?

Synthetic division is a quicker and more efficient method of dividing polynomials compared to traditional long division. It involves using only the coefficients of the polynomial rather than writing out the polynomial in its entirety.

3. What is the purpose of synthetic division?

The purpose of synthetic division is to simplify the process of dividing polynomials, making it easier to factorize and solve equations involving polynomials.

4. Can synthetic division be used for dividing any type of polynomial?

No, synthetic division can only be used when dividing a polynomial by a linear expression of the form (x - a). For dividing by more complex expressions, traditional long division must be used.

5. Are there any limitations to using synthetic division?

Yes, there are a few limitations to using synthetic division. It can only be used for dividing polynomials with integer coefficients and when dividing by a linear expression with a leading coefficient of 1. Also, the divisor must be of the form (x - a), meaning it cannot have any other terms or exponents.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Replies
1
Views
842
Replies
2
Views
830
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
28
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
0
Views
1K
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
7
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
1K
Back
Top