3

Set of equations

This is something I need to achieve, I have a problem with the last equation. How can I underline this the same way as above? I've tried writing it as one fraction, but the other fraction in numerator gets smaller and the equal sign isn't in line with other signs. Could you please advise?

begin{eqnarray*}
\frac{2}{3}=0,66666\ 66667\ (-) \\
\frac{2}{3\cdot 3 \cdot 9}=0,02469\ 13580\ (+) \\
\frac{2}{3\cdot 5 \cdot 9^{2}}=0,00164\ 60905\ (+) \\
\frac{2}{3\cdot 7 \cdot 9^{3}}=0,00013\ 06421\ (+) \\
\frac{2}{3\cdot 9 \cdot 9^{4}}=0,00001\ 12901\ (-) \\
\frac{2}{3\cdot 11 \cdot 9^{5}}=0,00000\ 10264\ (-) \\
\frac{2}{3\cdot 13 \cdot 9^{6}}=0,00000\ 00965\ (-) \\
\frac{2}{3\cdot 15 \cdot 9^{7}}=0,00000\ 00093\ (-) \\
\end{eqnarray*}

This is the code, but don't know what about last part...

Werner
  • 603,163
Thomas
  • 31

3 Answers3

3

I would construct this in a regular array, provided that there is no requirement for the construction to break across the page boundary. Here is such an implementation:

enter image description here

\documentclass{article}

\usepackage{array}

\begin{document}

\[
  \renewcommand{\arraystretch}{2.1}% http://tex.stackexchange.com/q/31672/5764
  \begin{array}{ >{\displaystyle}r @{} >{{}}l c}
                       \frac{2}{3} &= 0.66666\,66667 & (-) \\
       \frac{2}{3 \cdot 3 \cdot 9} &= 0.02469\,13580 & (+) \\
     \frac{2}{3 \cdot 5 \cdot 9^2} &= 0.00164\,60905 & (+) \\
     \frac{2}{3 \cdot 7 \cdot 9^3} &= 0.00013\,06421 & (+) \\
     \frac{2}{3 \cdot 9 \cdot 9^4} &= 0.00001\,12901 & (-) \\
    \frac{2}{3 \cdot 11 \cdot 9^5} &= 0.00000\,10264 & (-) \\
    \frac{2}{3 \cdot 13 \cdot 9^6} &= 0.00000\,00965 & (-) \\
    \frac{2}{3 \cdot 15 \cdot 9^7} &= 0.00000\,00093 & (-) \\[0.7\normalbaselineskip]
    \hline
                                   &= 0.69314\,71805
  \end{array}
\]

\end{document}
Werner
  • 603,163
3

use the align* environment from amsmath and a simple \cline just like in a tabular

\documentclass{article}
\usepackage{amsmath}
\begin{document}

    \begin{align*}
    \frac{2}{3}                    &= 0.66666\,66667  ~(-) \\
    \frac{2}{3 \cdot 3 \cdot 9}    &= 0.02469\,13580  ~(+) \\
    \frac{2}{3 \cdot 5 \cdot 9^2}  &= 0.00164\,60905  ~(+) \\
    \frac{2}{3 \cdot 7 \cdot 9^3}  &= 0.00013\,06421  ~(+) \\
    \frac{2}{3 \cdot 9 \cdot 9^4}  &= 0.00001\,12901  ~(-) \\
    \frac{2}{3 \cdot 11 \cdot 9^5} &= 0.00000\,10264  ~(-)\\
    \frac{2}{3 \cdot 13 \cdot 9^6} &= 0.00000\,00965  ~(-)\\
    \frac{2}{3 \cdot 15 \cdot 9^7} &= 0.00000\,00093  ~(-)\\\cline{1-2}
                                   &= 0.69314\,71805
    \end{align*}

\end{document}

enter image description here

1

As possible starting point:

\documentclass{article}
    \usepackage{array,siunitx}
    \usepackage{mathtools}

    \begin{document}
    \begin{center}
\begin{tabular}{>{$}c<{$}}
    \begin{aligned}
\frac{2}{3}                 & = \num{0,6666666667}\ (-)   \\
\frac{2}{3\cdot 3\cdot 9}   & = \num{0,0246913580}\ (+)   \\
\frac{2}{3\cdot 3\cdot 9^2} & = \num{0,0016460905}\ (+)   \\
\frac{2}{3\cdot 3\cdot 9^3} & = \num{0,0001306421}\ (+)   \\
\frac{2}{3\cdot 3\cdot 9^4} & = \num{0,0000112901}\ (-)   \\
\frac{2}{3\cdot 3\cdot 9^5} & = \num{0,0000010264}\ (-)   \\
\frac{2}{3\cdot 3\cdot 9^6} & = \num{0,0000000965}\ (-)   \\
\frac{2}{3\cdot 3\cdot 9^7} & = \num{0,0000000093}\ (-)   \\[1ex]
    \hline
                            & = \num{0,6931471805}
    \end{aligned}
\end{tabular}
    \end{center}
\end{document}

The package array serves to determine >{$}c<{$}, siunitx for macro \num{...} which enable to grouping numbers in 3. For line is used standard \hline from tabular environment.

enter image description here

Zarko
  • 296,517
  • What's the purpose of tabular? – egreg Nov 28 '15 at 18:17
  • @eqgreg, only for draw line. As I see from your answer, this can be achieved without tabular environment with use of cline. – Zarko Nov 28 '15 at 22:19
  • I was mainly objecting to tabular instead of array. However, if you're using array, you can avoid the inner align, can't you? – egreg Nov 28 '15 at 22:21