1

I try to format my math like this in MathJax:

enter image description here

How can I do long division of polynomials in MathJax?

Kasper
  • 12,594
  • 12
  • 41
  • 63
  • Possible duplicate of [Way to show long division symbol )‾‾‾‾‾‾ in MathJax](https://stackoverflow.com/questions/22867785/way-to-show-long-division-symbol-in-mathjax) – Werner Oct 10 '18 at 05:28
  • 1
    @Werner The answer given there doesn't really work when aligning polynomials. – Kasper Oct 10 '18 at 08:51

1 Answers1

0

Old post, but I couldn't find an answer elsewhere, so here's how I solved this issue with two side-by-side arrays. Couldn't figure out how to make the lines shorter as I could in LaTex, but this was good enough for me:

<span class="math display">\[\begin{array}{r}
 \\
x^2 - 3) \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\phantom{.} \\
\end{array}
\begin{array}{rrrrrr}
     &amp; &amp; x^3 &amp; -2x^2 &amp; +4x &amp; -6 \\ \hline
 x^5 &amp; -2x^4 &amp; + x^3 &amp; &amp;-8x &amp; +18 \\ 
-x^5 &amp; &amp;+3x^3 \\ \hline
 &amp; -2x^4 &amp; +4x^3 \\
 &amp; 2x^4 &amp; &amp;-6x^2 \\ \hline
&amp; &amp; 4x^3 &amp; -6x^2 &amp; -8x \\
&amp; &amp; -4x^3 &amp; &amp;+12x \\ \hline \\
&amp; &amp; &amp;-6x^2 &amp; +4x &amp; +18 \\
&amp; &amp; &amp; 6x^2 &amp; &amp; -18 \\ \hline
&amp; &amp; &amp; &amp; 4x
\end{array}\]</span>

This displays as

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Spencer
  • 1
  • 1