Results 1 to 5 of 5

Math Help - Long division

  1. #1
    Senior Member
    Joined
    Feb 2008
    Posts
    297

    Long division

    Just wandering how to do long division in latex. Say I want to divide \frac{x^3+9x^2+28x+34}{x^2+8x+15}. The way I did it was as follows. Is there an easier or neater way of doing this? Thanks.

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x+1\
    x^2+8x+15\overline{)x^3+9x^2+28x+34}
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\underline{x^3+8x^2+15x}$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $x^2+13x+34$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\underline{x^2+ \ 8x+15}$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $5x+19$
    Last edited by acevipa; June 29th 2010 at 12:58 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Jun 2010
    Posts
    205
    Thanks
    1
    I made long division look sweet using tables. I forget all the exact commands, but if you use \begin{tabular}{c c c c c c}, where each "c" is a column, and you put some term of the polynomial into each column, you can then use \cline within the table to make horizontal lines over specific table cells. You'd also have to use a tricky combination of \multicolumn and \hline to form a horizontal line on exactly one side of one cell, to make it look the way it's supposed to. If you look at Getting to Grips with Latex - Tables - Latex Tutorials by Andrew Roberts @ School of Computing, University of Leeds, all of the basic techniques are there to show you how to do it. It's just time-consuming to get the details right. Maybe when I get within reach of my external hard-drive I'll see if I stored the .tex file where I made a long-division table and post the contents.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by acevipa View Post
    Just wandering how to do long division in latex. Say I want to divide \frac{x^3+9x^2+28x+34}{x^2+8x+15}. The way I did it was as follows. Is there an easier or neater way of doing this? Thanks.

    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $x+1$\newline
    $x^2+8x+15\overline{)x^3+9x^2+28x+34}$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\underline{x^3+8x^2+15x}$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $x^2+13x+34$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\underline{x^2+ \ 8x+15}$\\
    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $5x+19$
    This is an example copied from a solution set that I had to prepare a few years ago:
    \begin{array}{r@{}rrrrl}<br />
&&x^2&+7x&+10\\<br />
\cline{2-5}<br />
x-3\;|&\;x^3 &+ 4x^2& - 11x& - 25 \\<br />
&x^3&-3x^2 \\<br />
\cline{2-3}<br />
&&7x^2&-11x \\<br />
&&7x^2&-21x \\<br />
\cline{3-4}<br />
&&&10x&-25 \\<br />
&&&10x&-30&\quad\mbox{The quotient is }x^2+7x+10. \\<br />
\cline{4-5}<br />
&&&&5&\quad\mbox{The remainder is }5.<br />
\end{array}<br />
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Feb 2008
    Posts
    297
    Quote Originally Posted by Opalg View Post
    This is an example copied from a solution set that I had to prepare a few years ago:
    \begin{array}{r@{}rrrrl}<br />
&&x^2&+7x&+10\\<br />
\cline{2-5}<br />
x-3\;|&\;x^3 &+ 4x^2& - 11x& - 25 \\<br />
&x^3&-3x^2 \\<br />
\cline{2-3}<br />
&&7x^2&-11x \\<br />
&&7x^2&-21x \\<br />
\cline{3-4}<br />
&&&10x&-25 \\<br />
&&&10x&-30&\quad\mbox{The quotient is }x^2+7x+10. \\<br />
\cline{4-5}<br />
&&&&5&\quad\mbox{The remainder is }5.<br />
\end{array}<br />
    How come an error pops up when I try and do it?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Opalg View Post
    This is an example copied from a solution set that I had to prepare a few years ago:
    \begin{array}{r@{}rrrrl}<br />
&&x^2&+7x&+10\\<br />
\cline{2-5}<br />
x-3\;|&\;x^3 &+ 4x^2& - 11x& - 25 \\<br />
&x^3&-3x^2 \\<br />
\cline{2-3}<br />
&&7x^2&-11x \\<br />
&&7x^2&-21x \\<br />
\cline{3-4}<br />
&&&10x&-25 \\<br />
&&&10x&-30&\quad\mbox{The quotient is }x^2+7x+10. \\<br />
\cline{4-5}<br />
&&&&5&\quad\mbox{The remainder is }5.<br />
\end{array}<br />
    That is more or less how I do long division in the piece that I have in issue 2 of MHF-zine

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. long division
    Posted in the Algebra Forum
    Replies: 4
    Last Post: March 27th 2011, 12:31 PM
  2. big-o, but long division first
    Posted in the Discrete Math Forum
    Replies: 3
    Last Post: January 24th 2011, 12:45 PM
  3. long division
    Posted in the Pre-Calculus Forum
    Replies: 8
    Last Post: May 19th 2009, 06:52 AM
  4. Long Division
    Posted in the Algebra Forum
    Replies: 1
    Last Post: January 31st 2008, 01:56 PM
  5. Long Division
    Posted in the Algebra Forum
    Replies: 3
    Last Post: January 20th 2007, 05:39 AM

Search Tags


/mathhelpforum @mathhelpforum