Math formatting "Pro tips" edition: Long division at long last! -"?"

1 Answer
Nov 7, 2015

Here's my version of the long division format!

Explanation:

Ok, I've been working on this on and off for a couple of days now, ever since Ernest posted his technique here, and I think I finally came up with something very cool and very simple to write, too!

The technique is built around fractions and invisible characters. In a nutshell, you will use fractions and color(white)() to build the long division format line by line.

Before going into the fractions, it's worth noting that the color function works by breaking up the default black text color. So something like

  • without the hashtags

x^2 + color(red)(3x) + 2

  • with the hashtags

#x^2 + color(red)(3x) + 2#

is equivalent to

  • without the hashtags

color(black)(x^2 + color(red)(3x) + 2)

  • with the hashtags

#color(black)(x^2 + color(red)(3x) + 2)#

Of course, this implies that I can break up other color functions by using color(black)() to return to the default text color

  • without the hashtags

color(red)(x^2 + color(black)(3x) + 2

  • with the hashtags

#color(red)(x^2 + color(black)(3x) + 2#

Now, let's say that you have two fractions

#(a + b + c)/(a + b + c)" "# and #" "(d + e + f)/(d + e + f)#

If I were to write these two fractions one after the other, i.e. without any spaces between them, i would get

#(a + b + c)/(a + b + c)(d + e + f)/(d + e + f)#

Now notice what happens when I use color(white)() to make the numerators invisible

#color(white)((a + b + c))/(a + b + c) color(white)((d + e + f))/(d + e + f)#

Now look what happens when I have a fraction completely invisible and use color(black)() to make the denominator visible

  • without the hashtags

color(white)( (a + b + c)/color(black)(a + b + c))color(white)((d + e + f))/(d + e + f)

  • with the hashtags

#color(white)( (a + b + c)/color(black)(a + b + c))color(white)((d + e + f))/(d + e + f)#

Finally, adding a ")" to the denominator of the second fraction will get me

  • without the hashtags

color(white)( (a + b + c)/color(black)(a + b + c))color(white)((d + e + f))/(")" color(white)(x)d + e + f)

  • with the hashtags

#color(white)( (a + b + c)/color(black)(a + b + c))color(white)((d + e + f))/(")" color(white)(x)d + e + f)#

Now, to demonstarte this further, I'll use a solved example - I picked this one.

So, let's say that you have to write the long division format for #4x^2 - 2x^2 + x -7# divided by #x-8#. You would first solve it on paper (I assume that's the case for a lot of people) to get

enter image source here

You would then pair up lines to match the fraction format. To make things clear, I'll use red text to show where the white characters would be used.

  • without the hashtags

color(red)( (x-8)/color(black)(x-8)) color(red)( (4x^3 - 2x^2 + x - 7))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)

  • with the hashtags - using red

#color(red)( (x-8)/color(black)(x-8)) color(red)( (4x^3 - 2x^2 + x - 7))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)#

  • with the hashtags - using white

#color(white)( (x-8)/color(black)(x-8)) color(white)( (4x^3 - 2x^2 + x - 7))/( ")" color(white)(")")4x^3 - 2x^2 + x - 7)#

Now set up your fraction pairs. The second segment will start from

#(4x^3 - 32x^2)/(4x^3 + 30x^2)x/(+x)#

  • without the hashtags

(4x^3 - 32x^2)/(color(red)(4x^3 +) 30x^2) color(red)(x/color(black)(+x))

  • with the hashtags - using red

#(4x^3 - 32x^2)/(color(red)(4x^3 +) 30x^2) color(red)(x/color(black)(+x))#

  • with the hashtags - using white

#(4x^3 - 32x^2)/(color(white)(4x^3 +) 30x^2) color(white)(x/color(black)(+x))#

The next two-line segment is

#(30x^2 - 240x)/(30x^2 - 241x) (-7)/(-7)#

  • with the hashtags - using red

#(30x^2 - 240x)/(color(red)(30x^2 -) 241x) color(red)( (-7)/color(black)(-7)#

  • with the hashtags - using white

#(30x^2 - 240x)/(color(white)(30x^2 -) 241x) color(white)( (-7)/color(black)(-7)#

The last two-line segment is

#(241x - 1928)/(241x - 1921)#

  • with the hashtags - using red

#(241x - 1928)/(color(red)(241x -) 1921)#

  • with the hashtags - using white

#(241x - 1928)/(color(white)(241x -) 1921)#

Finally, put all these together to get

  • with the hashtags - using red

#color(red)( (x-8)/color(black)(x-8)) color(red)( (4x^3 - 2x^2 + x - 7))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)#
#(4x^3 - 32x^2)/(color(red)(4x^3 +) 30x^2) color(red)(x/color(black)(+x))#
#(30x^2 - 240x)/(color(red)(30x^2 -) 241x) color(red)( (-7)/color(black)(-7)#
#(241x - 1928)/(color(red)(241x -) 1921)#

To space these out, use color(white)() in the beginning of every code line

  • with the hashtags - using red

#color(red)( (x-8)/color(black)(x-8)) color(red)( (4x^3 - 2x^2 + x - 7))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)#
#color(red)(-xxxx)(4x^3 - 32x^2)/(color(red)(4x^3 +) 30x^2) color(red)(x/color(black)(+x))#
#color(red)(-xxxxxxxxx)(30x^2 - 240x)/(color(red)(30x^2 -) 241x) color(red)( (-7)/color(black)(-7)#
#color(red)(-xxxxxxxxxxxxxx)(241x - 1928)/(color(red)(241x -) 1921)#

  • with the hashtags - using white

#color(white)( (x-8)/color(black)(x-8)) color(white)( (4x^3 - 2x^2 + x - 7))/( ")" color(white)(")")4x^3 - 2x^2 + x - 7)#
#color(white)(-xxxx)(4x^3 - 32x^2)/(color(white)(4x^3 +) 30x^2) color(white)(x/color(black)(+x))#
#color(white)(-xxxxxxxxx)(30x^2 - 240x)/(color(white)(30x^2 -) 241x) color(white)( (-7)/color(white)(-7)#
#color(white)(-xxxxxxxxxxxxxx)(241x - 1928)/(color(white)(241x -) 1921)#

Finally, use color(black)() to add the terms you need in the numerator of the first fraction

  • without the hashtags

color(red)( (x-8)/color(black)(x-8)) color(red)( (color(black)(4x^3 + 30x) x color(black)(+241)))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)

  • with the hashtags - using red

#color(red)( (x-8)/color(black)(x-8)) color(red)( (color(black)(4x^3 + 30x) x color(black)(+241)))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)#

  • with the hashtags - using white

#color(white)( (x-8)/color(black)(x-8)) color(white)( (color(black)(4x^3 + 30x) x color(black)(+241)))/( ")" 4x^3 - 2x^2 + x - 7)#

The final product will look like this

  • with the hashtags- using red

#color(red)( (x-8)/color(black)(x-8)) color(red)( (color(black)(4x^3 + 30x) x color(black)(+241)))/( ")" color(red)(")")4x^3 - 2x^2 + x - 7)#
#color(red)(-xxxx)(4x^3 - 32x^2)/(color(red)(4x^3 +) 30x^2) color(red)(x/color(black)(+x))#
#color(red)(-xxxxxxxxx)(30x^2 - 240x)/(color(red)(30x^2 -) 241x) color(red)( (-7)/color(black)(-7)#
#color(red)(-xxxxxxxxxxxxxx)(241x - 1928)/(color(red)(241x -) 1921)#

  • with the hashtags - using white

#color(white)( (x-8)/color(black)(x-8)) color(white)( (color(black)(4x^3 + 30x) x color(black)(+241)))/( ")" 4x^3 - 2x^2 + x - 7)#
#color(white)(-xxxx)(4x^3 - 32x^2)/(color(white)(4x^3 +) 30x^2) color(white)(x/color(black)(+x))#
#color(white)(-xxxxxxxxx)(30x^2 - 240x)/(color(white)(30x^2 -) 241x) color(white)( (-7)/color(white)(-7)#
#color(white)(-xxxxxxxxxxxxxx)(241x - 1928)/(color(white)(241x -) 1921)#

Now, as you would imagine, each long division example will have its specific spacing issues, so you're going to have to use color(white)() to create spacing as needed.

So basically, once you set up your fraction pairs, you're good to go!