# Showing work for a long division problem?

**URL:** <https://discourse.hypatiasys.com/t/showing-work-for-a-long-division-problem/211>\
**Category:** How to type...?\
**Created:** [July 6, 2023, 11:01pm UTC](https://discourse.hypatiasys.com/t/showing-work-for-a-long-division-problem/211 "2023-07-06T23:01:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmontgomery](https://discourse.hypatiasys.com/letter_avatar_proxy/v4/letter/b/a587f6/32.png) [@bmontgomery](https://discourse.hypatiasys.com/u/bmontgomery)\
**Post date:** [July 6, 2023, 11:01pm UTC](https://discourse.hypatiasys.com/t/showing-work-for-a-long-division-problem/211/1 "2023-07-06T23:01:57Z")

</div>

I can create a problem with the long division symbol, but can’t create additional lines to show the steps. Is there way to create a long division problem and be able to show the work? I use a matrix to do this for addition, subtraction and multiplication but am struggling with using a matrix for long division.

---

<div class="post-metadata">

**Author:** ![admin](https://discourse.hypatiasys.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@admin](https://discourse.hypatiasys.com/u/admin)\
**Post date:** [August 22, 2023, 4:50pm UTC](https://discourse.hypatiasys.com/t/showing-work-for-a-long-division-problem/211/2 "2023-08-22T16:50:25Z")

</div>

Hi,

we do not have a particular form for creating long divisions. However, it can be composed of 3 objects put together into centered multiline environment. It’s a bit tricky, because alignment looks different in the editor and in the final math.

Here is an example:

- in editor:  
 ![image](https://discourse.hypatiasys.com/uploads/default/original/1X/f93e630d5f989260f5ef48fe35f06a7f7dedb31d.png)
- inserted math:  
 ![image](https://discourse.hypatiasys.com/uploads/default/original/1X/d7227b1852517d7bc0795715fe5bc1cfd4301ea7.png)

Steps:

- start with an empty math
- press Enter and choose Centered
- in the first row insert a matrix (without brackets) with 1 row and n+1 columns (+1 for better alignment)
- in the second row insert long division command and on then insert a 1xk matrix on the left and 1xm matrix on the right (where k+m = n). Add 2 spaces on each side of  
 ![image](https://discourse.hypatiasys.com/uploads/default/original/1X/2d842b2fac595259135f1ce0ae31ae4375083dbe.png)  
for better alignment
- press Enter to create the third row and insert lx(n+1) matrix, add vertical line for every second row using the matrix menu on the left

Mathcode:

```auto
\begin{gather*}
{\begin{matrix}
{}&{}&{}&{}&{5}&{7}&{9}\\
\end{matrix}}\\
{\ldiv{\begin{matrix}
{1}&{3\,}\\
\end{matrix}}{\begin{matrix}
{\,7}&{5}&{2}&{7}\\
\end{matrix}}}\\
{\begin{matrix}
{}&{}&{}&{6}&{5}&{}&{}\\
\hline
{}&{}&{}&{1}&{0}&{2}&{}\\
{}&{}&{}&{}&{9}&{1}&{}\\
\hline
{}&{}&{}&{}&{1}&{1}&{7}\\
{}&{}&{}&{}&{1}&{1}&{7}\\
\hline
{}&{}&{}&{}&{}&{}&{0}\\
\end{matrix}}	
\end{gather*}

```

(to insert this math into editor, copy it the whole mathcode above, then paste it in the empty editor)
