4

I found a typesetting of series long division I want to replicate in a book I've been reading:

enter image description here

So I tried with the following code (using different polynomial than the example):

\begin{align*}
\renewcommand\arraystretch{2}
\begin{array}{r@{\hskip\arraycolsep}c@{\hskip\arraycolsep}l*2r}
&&\dfrac{1}{z}+\dfrac{1}{3!}z&+\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^3+\cdots\\
\cline{2-4}
z-\dfrac{1}{3!}z^3+\dfrac{1}{5!}z^4-\cdots&\Bigg)&1\\
&&1-\dfrac{1}{3!}z^2&+\dfrac{1}{5!}z^4-\cdots\\
\cline{2-4}
&&\hfill\dfrac{1}{3!}z^2&-\dfrac{1}{5!}z^4+\cdots\\
&&\hfill\dfrac{1}{3!}z^2&-\dfrac{1}{(3!)^2}z^4+\cdots\\
\cline{2-4}
&&&\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^4-\cdots\\
&&&\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^4-\cdots\\
\cline{2-4}
&&&\multicolumn{1}{c}{\vdots}\\
\end{array}
\end{align*}

and here is the result:

enter image description here

As you may see, the are some differences between the example and my attempt (besides fonts, of course). The biggest problem seems to be associate with the vertical spacing, is there anything I can do to improve the result? Thank you very much!

  • First of all you have some minor mistakes regarding some signs in your code compared to the "original" version. Is this normal or just typing mistakes? – Ludovic C. Jul 12 '13 at 10:33
  • 2
    I used a different polynomial. Sorry if I didn't state it clear. – Francis Jul 12 '13 at 10:35
  • You have that you used a different polynomial in your post. It is right below the first image. – dustin Jul 12 '13 at 10:38
  • Welcome to TeX.SX! You can have a look on our our starter page to familiarize yourself further with our format. – Claudio Fiandrino Jul 12 '13 at 10:48
  • 2
    isn't that Brown/Churchill:Complex Variable – RE60K Dec 25 '14 at 19:20
3

The only difference I could see was the spacing between the rows that caused some of the equations to lie on the cline.

Adding [.1cm] or whatever distance separation you want will achieve a bigger spacing.

\documentclass{article}
\usepackage{amsmath, array}
\begin{document}
\begin{align*}                                                                      
  \renewcommand\arraystretch{2}                                                     
  \begin{array}{r@{\hskip\arraycolsep}c@{\hskip\arraycolsep}l*2r}                   
    &&\dfrac{1}{z}+\dfrac{1}{3!}z&+\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^3+    \cdots\\[.1cm]                                                                      
    \cline{2-4}                                                                     
    z-\dfrac{1}{3!}z^3+\dfrac{1}{5!}z^4-\cdots&\Bigg)&1\\[.1cm]                     
    &&1-\dfrac{1}{3!}z^2&+\dfrac{1}{5!}z^4-\cdots\\[.1cm]                           
    \cline{2-4}                                                                     
    &&\hfill\dfrac{1}{3!}z^2&-\dfrac{1}{5!}z^4+\cdots\\[.1cm]                       
    &&\hfill\dfrac{1}{3!}z^2&-\dfrac{1}{(3!)^2}z^4+\cdots\\[.1cm]                   
    \cline{2-4}                                                                     
    &&&\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^4-\cdots\\[.1cm]               
    &&&\left[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\right]z^4-\cdots\\[.1cm]               
    \cline{2-4}                                                                     
    &&&\multicolumn{1}{c}{\vdots}\\                                                 
  \end{array}                                                                       
\end{align*}
\end{document}

enter image description here


Also, if you want to use a square root in stead of ) and \cline, you could do

\sqrt{1 + \phantom{\left(\frac{10^{2}}{10^{2}}\right)+50000000000000000000000000}}

Then you will have to adjust your spacing of division. You could then adjust +50000000... to cover as much width as you need. There may be even a smooth way to extend the radical without using phantom. I will look into and see if I can find something or maybe someone else will know.

Instead of using \phantom alone, I have adapted Werner's solution from Large Square Root Symbols

\newcommand{\blank}[1]{\hfil\penalty1000\hfilneg\rule[-3pt]{#1}{1cm}}  

\[ 3 = \sqrt{\phantom{\blank{5cm}}} \]

I modified his example to take care of height too. You can adjust this to whatever you want by changing 1cm and the width is argument of \blank. So this produces:

enter image description here


Furthermore, we can adapt How can I create a multiline split inside of a radical inside of an array environment? in order to use the radical in better manner.

By using aligned environment, we can achieve the image below (I only edited the first few lines as an example)

enter image description here

The code is:

\documentclass{article}
\usepackage{amsmath, array}
\begin{document}
\begin{align*}                                                                      
  \renewcommand\arraystretch{2}                                                     
  \newcommand{\blank}[1]{\hfil\penalty1000\hfilneg\rule[-3pt]{#1}{.75cm}}           
  \begin{array}{r@{\hskip\arraycolsep}c@{\hskip\arraycolsep}l*2r}                   
    &&\begin{aligned}                                                               
      \quad\dfrac{1}{z}&+\dfrac{1}{3!}z                                             
      +\bigg[\dfrac{1}{(3!)^2}-\dfrac{1}{5!}\bigg]z^3 +\cdots                       
      \end{aligned}\\[.1cm]                                                         
    z-\dfrac{1}{3!}z^3+\dfrac{1}{5!}z^4-\cdots&&\sqrt{\begin{aligned}               
        1 & \phantom{\blank{4.5cm}}                                                 
      \end{aligned}}\\[.1cm]                                                        
    &&\begin{aligned}                                                               
      \quad 1&-\dfrac{1}{3!}z^2 & \phantom{5\bigg[\dfrac{1}{3}} \quad               
      +\dfrac{1}{5!}z^4-\cdots                                                      
    \end{aligned}\\[.1cm]                                                           
    \cline{2-3}                                                                     
    &&\begin{aligned}                                                               
      \quad\phantom{1\hspace{.15cm}-}\dfrac{1}{3!}z^2 &                             
      \phantom{55l\bigg[\dfrac{1}{3!}}                                              
      \quad-\dfrac{1}{5!}z^4+\cdots                                                 
    \end{aligned}\\[.05cm]                                                          
  \end{array}                                                                       
\end{align*}
\end{document}
  • Thanks for the advice! However, besides that, the original example seems used a \big) in its long division symbol. If switch my \bigg) to that the parenthesis won't touch the horizontal line. – Francis Jul 12 '13 at 10:53
  • @Francis I have made some additional edits you may want to consider. – dustin Jul 12 '13 at 11:21
  • Thanks for all the effort you put into your answer! I will look into them and see if I can improve. – Francis Jul 12 '13 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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