# Need help -- Having trouble with eqnarray*/gathered/aligned

• LaTeX
• benorin
In summary: I do not have any idea of what your code is supposed to do.I am an expert summarizer, so I will provide a summary of your code instead. It seems that you are trying to create a summary of a conversation that involves multiple integrals and mathematical equations. You are having trouble getting the code to compile properly on Overleaf, and you want it to display with aligned equal signs. You also mention using eqnarray* and aligned, but it's not clear how they are related. In the end, it seems that you are trying to use a LaTeX editor for the first time.
benorin
Homework Helper
TL;DR Summary
I have a long chain of equalities that I trying to get to display correctly with looking ugly or going off the page. I got this to work on this forum (MathJax) but having various issues in Overleaf
Code:
\begin{gathered} Z(n) = \int_{C^n}  {\tfrac{{\prod\nolimits_{i = 1}^n {d{x_i}} }}{{1 - \prod\nolimits_{k = 1}^n {{x_k}} }} \\ &=& \int_{C^{n - 1}}  {\log \left( {\tfrac{1}{{1 - \prod\nolimits_{k = 1}^{n - 1} {{x_k}} }}} \right) \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }   \\ &=& \int_{C^{n - 1}}   {\log \left[ {\prod\limits_{q = 0}^\infty  {\left( {1 + \prod\limits_{k = 1}^{n - 1} {x_k^{{2^q}}} } \right)} } \right] \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }  \\  = \sum\limits_{q = 0}^\infty  \int_{C^{n - 1}}  {\log \left( {1 + \prod\limits_{k = 1}^{n - 1} {x_k^{{2^q}}} } \right) \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }   \\ = \mathop  \lim\limits_{N \to \infty } \,\sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{k}\int_{C_N^{n - 1}}  {\prod\limits_{k = 1}^{n - 1} {x_k^{k{2^q} - 1}d{x_k}} } } }   \\ &=& \mathop  \lim\limits_{N \to \infty } \,\sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{k}{{\left( {n - 2} \right)}^{\sum\limits_{p = 1}^n {\frac{{k{2^q}}}{{2N}}} }}{{\prod\limits_{i = 1}^{n - 1} {\left[ {\frac{1}{{2N}}\Gamma \left( {\frac{{k{2^q}}}{{2N}}} \right)} \right]} } \mathord{\left/ {\vphantom {{\prod\limits_{i = 1}^{n - 1} {\left[ {\frac{1}{{2N}}\Gamma \left( {\frac{{k{2^q}}}{{2N}}} \right)} \right]} } {\Gamma \left( {1 + \sum\limits_{j = 1}^{n - 1} {\frac{{k{2^q}}}{{2N}}} } \right)}}} \right. } {\Gamma \left( {1 + \sum\limits_{j = 1}^{n - 1} {\frac{{k{2^q}}}{{2N}}} } \right)}}} }  \\ &=& \sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}{2^{\left( {n - 1} \right)q}}}} \cdot \underbrace {\mathop  \lim\limits_{N \to \infty } \,{{\left( {n - 2} \right)}^{\frac{{\left( {n - 1} \right)k{2^q}}}{{2N}}}}}_{ = {{\left( {n - 2} \right)}^0}} \cdot \underbrace {\mathop  \lim\limits_{N \to \infty } \,\tfrac{{{\Gamma ^{n - 1}}\left( {1 + \frac{{k{2^q}}}{{2N}}} \right)}}{{\Gamma \left( {1 + \tfrac{{\left( {n - 1} \right)k{2^q}}}{{2N}}} \right)}}}_{ = 1{\text{ Limit 2.4}}}} } \\  = \sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}} \cdot {{\left( {\tfrac{1}{{{2^{n - 1}}}}} \right)}^q}} }  = \sum\limits_{k = 1}^\infty  {\left[ {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}}\sum\limits_{q = 0}^\infty  {{{\left( {\tfrac{1}{{{2^{n - 1}}}}} \right)}^q}} } \right]}  \\ = {\left( {1 - {2^{1 - n}}} \right)^{ - 1}}\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}}} = \sum\limits_{k = 1}^\infty  {\tfrac{1}{{{k^n}}}}  = \zeta \left( n \right)  \\ \end{gathered}

Note there were \$'s at the beginning and end of the above code. I can't get it to compile with eqnarray in Overleaf so I posted the gathered. When I use aligned it ignores the newline commands and just runs off the page in just a single row.

This is what Overleaf does with that code

Ideally we will get this to work with eqnarray*, that is how I want it to display with aligned equal signs, on the forum it looks like this (except in latex I used only a single integral sign to denote the multiple integrals)

Note the Latex code above is slightly different. Thanks. BTW this is the first time using an actual LaTeX editor.[/code]

Your code looks incomprehensible to me. But I can determine that the '{' in character 37 does not seem to be matched by a closing '}'. Does that make a difference?

jedishrfu

## 1. Can you explain the difference between eqnarray, gathered, and aligned?

Eqnarray, gathered, and aligned are all environments in LaTeX used for displaying multiple equations in a single line or block. However, there are some key differences between them. Eqnarray is the oldest and most basic of the three, but it has several limitations and is not recommended for use. Gathered is similar to eqnarray, but it allows for better spacing and alignment of equations. Aligned is the most versatile and recommended environment, as it allows for multiple alignments within a single equation or block.

## 2. Why is eqnarray not recommended for use?

Eqnarray has several limitations, including poor spacing and alignment of equations, as well as inconsistent numbering of equations. It also has some compatibility issues with other packages and can cause errors in certain situations. Therefore, it is generally advised to use the gathered or aligned environments instead.

## 3. How do I align multiple equations using the aligned environment?

To align multiple equations using the aligned environment, use the & symbol to specify the points of alignment. For example, to align three equations at the equals sign, you would use the code "\begin{aligned} x + y &= 10 \\ 2x - y &= 5 \\ x &= 3 \end{aligned}" This will align the equations as a system of equations, with the equals signs lined up.

## 4. Can I use the gathered or aligned environments within another math environment?

Yes, you can use the gathered or aligned environments within other math environments, such as equation or align. This can be useful for cases where you want a single equation to have multiple lines or alignments.

## 5. Are there any limitations to the number of equations that can be displayed within gathered or aligned?

No, there are no limitations to the number of equations that can be displayed within gathered or aligned. You can have as many equations as needed, as long as they are properly aligned using the & symbol. However, having too many equations in a single line or block can make it difficult to read, so it is recommended to split them up into multiple lines or blocks if necessary.

• Topology and Analysis
Replies
11
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
298
• Topology and Analysis
Replies
2
Views
2K
• Calculus and Beyond Homework Help
Replies
6
Views
522
• Calculus and Beyond Homework Help
Replies
1
Views
380
• Calculus and Beyond Homework Help
Replies
2
Views
310
• Calculus and Beyond Homework Help
Replies
15
Views
1K
• Calculus
Replies
1
Views
2K
• Calculus and Beyond Homework Help
Replies
4
Views
445
• MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K