# Long division in LaTeX

• LaTeX
How do you write each line of long division in LaTeX on here ?

Thanks

fresh_42
Mentor
2021 Award
How do you write each line of long division in LaTeX on here ?

Thanks
This has been my solution:
(Sorry, for the sub-optimal alignment.)

##(x^3+2x+1) : (x-a) \rightarrow x^2##
##-[(x-a)\cdot x^2] = -x^3+ax^2##
##\text{+________________________}##
##ax^2 + 2x +1 / : (x-a) \rightarrow ax##
##-[(x-a)\cdot ax] = -ax^2+a^2x##
##\text{+________________________}##
##2x+a^2x+1 / :(x-a) \rightarrow (2+a^2)##
##-[(x-a)\cdot (2+a^2)] = -2x+2a-a^2x+a^3##
##\text{+________________________}##
##2a+a^3+1##

jim mcnamara and Janosh89
.Scott
Homework Helper
## \hspace{11.5mm}536##
## 23\overline{)12345}##
## \hspace{7mm}\underline{115}##
## \hspace{11.5mm}84##
## \hspace{11.5mm}\underline{69}##
## \hspace{11.5mm}155##
## \hspace{11.5mm}\underline{138}##
## \hspace{14mm}17##

# \hspace{11.5mm}536#
# 23\overline{)12345}#
# \hspace{7mm}\underline{115}#
# \hspace{11.5mm}84#
# \hspace{11.5mm}\underline{69}#
# \hspace{11.5mm}155#
# \hspace{11.5mm}\underline{138}#
# \hspace{14mm}17#

Mark44, jim mcnamara and Janosh89
Aufbauwerk 2045
Have you looked at the longdivision package?

i.e.

\usepackage{longdivision}