I am teaching polynomial long division to my high school students. Not a pleasant topic to have to cover. I went to use Wolfram|Alpha and obviously, internally, they have a really elegant way to express the results of long divisions.


I don't suspect there is any easy way to directly ask Alpha (from Mathematica) to do that division for me? Has anyone implemented anything like this? Would it involve using a table or matrix? Everything is nicely lined up and typeset; it would be helpful to see how such a structure was created.


  • $\begingroup$ there is a demo demonstrations.wolfram.com/PolynomialLongDivision $\endgroup$
    – Nasser
    Commented Nov 6, 2013 at 6:12
  • $\begingroup$ thanks, yes, I had seen that. The math is great but the formatting is nothing like what we use at the high school level. The Alpha output is very elegant... just like they would see in their textbooks... $\endgroup$ Commented Nov 6, 2013 at 6:33

2 Answers 2


You could perhaps try to use the WolframAlpha function with the pods?

   "polynomial long division (y^3-6y+20)/(y-3)", \
{{"QuotientAndRemainder", 1}, "Content"}, 
   PodStates -> {"QuotientAndRemainder__Step-by-step solution"}], 
   "polynomial long division (y^3-6y+20)/(y-3)", \
{{"QuotientAndRemainder", 2}, "Content"}, 
   PodStates -> {"QuotientAndRemainder__Step-by-step solution"}]}

enter image description here

Use == to start a session with Wolfram Alpha and then type your equation

enter image description here

Then choose the show steps in the equation solved windows

enter image description here

Now select the plus button to the right and select Formatted pod or Subpod (I chose now formatted which even looks better. This will generate the 'complex' expression and start a Wolfram session to only show this part of the content.

enter image description here

And here is the formatted Pod output

WolframAlpha["polynomial long division (y^3-6y+20)/(y-3)", 
 IncludePods -> "QuotientAndRemainder", 
 AppearanceElements -> {"Pods"}, 
 TimeConstraint -> {30, Automatic, Automatic, Automatic}, 
 PodStates -> {"QuotientAndRemainder__Step-by-step solution"}]

enter image description here

So with that you play around!

  • $\begingroup$ Wow.... exactly what I was looking for (aside from an actual "long division function". How does a person figure out that syntax exactly? I really appreciate the answer since it does provide a pattern and hopefully I can do similar things with it. As always, the answers and support of this community are invaluable, and are extending to the work I do with my students. thank you! $\endgroup$ Commented Nov 6, 2013 at 13:36
  • $\begingroup$ I hesitate to ask for more... but I know with Alpha you can specific output size, background color, things like that. If it's not a huge change, could someone add how to modify that input to do some of those sorts of things. It would help be to learn more about the connection between Mathematica and Alpha and how to use them... $\endgroup$ Commented Nov 6, 2013 at 13:50
  • $\begingroup$ @TomDeVries Hi Tom, actually its very simple. I'll edit the answer to show you how. $\endgroup$
    – Lou
    Commented Nov 6, 2013 at 13:53
  • $\begingroup$ @TomDeVries Hi Tom, At the end the output is build with frames and boxes etc which is documented very well. If you use the output as input with //FullForm you can see how the output is constructed. Then you can also modify it but this does generate a second processing layer. I don't know the syntax to do it within the wolfram alpha command. $\endgroup$
    – Lou
    Commented Nov 6, 2013 at 14:33
  • $\begingroup$ Thanks again for the extra comments, that will help me to be able to explore further. $\endgroup$ Commented Nov 6, 2013 at 17:29

I have implemented polynomial long division in finite fields as a ruby-script, see Formatting results of a polynomial long division (Extension for finite fields)

It produces shell and Latex output.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.