6

I'm trying to make an equation array

\begin{eqnarray*}  
f^{(a)} (0) &=& \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{f(z)}{(z)^{a+1}} dz &=&   
  &=& \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{z-z^{2}-z^{3}-\dots -z^{n-1}}{(z^{a+1})(1-z-z^{2}-z^{3}-%
\dots -z^{n})} dz   
\end{eqnarray*}%

Everything appears to be fine except there's an extra = sign to the far right and I can't seem to find any way to get rid of it. Any help would be very appreciated!

Addendum: I'm having trouble formatting this

\begin{align*}  
$$f_a = Res (F(z))_{z=0}   
&= \Big(Res(F(z)_{z=0} +\sum_{\beta} \text{Res}(F(z)),z=\beta)\Big) - \Big(\sum_{\beta}   \text{Res}(F(z)),z=\beta))     
&= {2\pi i}\oint F(z)dz -  \Big(\sum_{\beta} \text{Res}(F(z)),z=\beta)\Big)   
&= - \Big(\sum_{\beta} \text{Res}(F(z)),z=\rho)\beta) $$   
\end{align}%   

The whole thing is simply staying in one line instead of breaking up into the proper formatting.

Mico
  • 506,678

2 Answers2

9

You are missing \\ to finish your first line.

screenshot

I would recommend using align from the amsmath package instead of eqnarray which is considered obsolete as detailed in eqnarray vs align The align environment gives much better spacing.

A complete MWE follows, including the implementation of align

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\subsection*{original using eqnarray}
\begin{eqnarray*}  
    f^{(a)} (0) &=& \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{f(z)}{(z)^{a+1}} dz \\
                &=& \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{z-z^{2}-z^{3}-\dots -z^{n-1}}{(z^{a+1})(1-z-z^{2}-z^{3}- \dots -z^{n})} dz   
\end{eqnarray*}%

\subsection*{new-- recommended using align}
\begin{align*}  
    f^{(a)} (0) & = \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{f(z)}{(z)^{a+1}} dz                                                        \\
                & = \frac{a!}{2 \pi i} \oint_{ |z| = \frac{\varepsilon}{r}} \frac{z-z^{2}-z^{3}-\dots -z^{n-1}}{(z^{a+1})(1-z-z^{2}-z^{3}- \dots -z^{n})} dz 
\end{align*}%

\end{document}

Here's a possible solution for your follow-up question- note that I have used \DeclareMathOperator as described by @Mico

Put this in your preamble:

\DeclareMathOperator{\res}{Res}

and then you can use \res as follows:

\subsection*{Follow-up question}
\begin{align*}  
    f_a & = \res{(F(z))}_{z=0}                                                                                           \\
        & = \Big(\res{(F(z)}_{z=0} +\sum_{\beta} \res{(F(z))},z=\beta)\Big) - \Big(\sum_{\beta}   \res{(F(z))},z=\beta)) \\
        & = {2\pi i}\oint F(z)dz -  \Big(\sum_{\beta} \res{(F(z))},z=\beta)\Big)                                         \\
        & = - \Big(\sum_{\beta} \res{(F(z))},z=\rho)\beta)                                                               \\
\end{align*}%   

Note that the issue with your code in this case was, as before, the lack of \\ to illustrate a new line.

Moriambar
  • 11,466
cmhughes
  • 100,947
5

This answer addresses your follow-up question only; I believe @cmhughes has already fully answered the original question.

There are several problems with your code; the first two items in the following list have already been pointed out by @Werner.

  • One must terminate each line of intended output with a \\ (double backslash);
  • the align and align* environments already put TeX into displaymath mode -- don't provide $$ directives as well;
  • be sure to type \end{align*} rather than \end{align} -- the two environments are not the same;
  • when you have \Big( directives, take care to type \Big) rather than just ) to end the parenthetical expression. Better yet, use \Bigl( and \Bigr);
  • you use \text{Res} in some cases but just Res in others, leading to inconsistent typeset appearance of the string. Since "Res" is an operator name (as are "sin" and "log", say), you could define a macro \Res to typeset "Res" in upright letters consistently. I suggest you include the instruction

    \DeclareMathOperator{\Res}{Res}
    

    in the preamble -- after loading the amsmath package, which provides the \DeclareMathOperator command -- and then use \Res throughout the math expressions of your document.

Mico
  • 506,678
  • \Bigl( and \Bigr) is preferable to keep the opening and closing atom nature of the parentheses. And \textrm is redundant with \DeclareMathOperator – egreg Jan 27 '13 at 13:47
  • @egreg -- thanks! I'll change my write-up. – Mico Jan 27 '13 at 14:13
  • I have deleted my answer in the dupe and upvoted this. This answer is more complete than my deleted answer. :-) – hpesoj626 Jan 28 '13 at 04:35