2

I want to write equation with this code.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    \begin{eqnarray}
        &\dfrac{d\mu(x)}{dx} &= \mu(x)\left(\dfrac{x}{1+x^2}\right)\\
        \iff&\int\dfrac{d\mu(x)}{\mu(x)}&=\int\left(\dfrac{x}{1+x^2}\right)dx
    \end{eqnarray}
\end{document}

enter image description here Why the integral symbol is small? How to make it bigger?

EDIT:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    \begin{align}
        &\dfrac{d\mu(x)}{dx} &= \mu(x)\left(\dfrac{x}{1+x^2}\right)\\
        \iff&\int\dfrac{d\mu(x)}{\mu(x)}&=\int\left(\dfrac{x}{1+x^2}\right)dx
    \end{align}
\end{document}

If I use align, the result is enter image description here

The space before = sign is too long.

5
  • 7
    Never use eqnarray. It's buggy.
    – egreg
    Commented Oct 22, 2020 at 11:17
  • 3
    you are misusing eqnarray, the middle column is supposed to be &=& and set in inline mode. It is best to avoid eqnarray, you are loading amsmath and can use align Commented Oct 22, 2020 at 11:17
  • 1
    @egreg I remembered well :-) :-) I remembered that eqnarray was a depreciated command and created problems.
    – Sebastiano
    Commented Oct 22, 2020 at 11:19
  • If I use align, the space before = sign is too long. Commented Oct 22, 2020 at 11:22
  • 3
    You are not using the correct number of &'s in align. Here there should only be onw & per row (&=) and I'd use \iff\quad \int ..., not need to align there too.
    – daleif
    Commented Oct 22, 2020 at 11:35

2 Answers 2

4

You can use alignat:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
  && \frac{d\mu(x)}{dx}          &= \mu(x)\left(\frac{x}{1+x^2}\right) \\
\Longleftrightarrow\quad
  && \int\dfrac{d\mu(x)}{\mu(x)} &= \int\left(\dfrac{x}{1+x^2}\right)dx
\end{alignat}

\end{document}

enter image description here

Never use eqnarray, under any circumstances.

6

Don't use eqnarray. Since you load the amsmath package anyway, I suggest you use an align environment with a single alignment point per row.

enter image description here

\documentclass{article}
\usepackage{amsmath,mleftright}
\mleftright
\begin{document}
    \begin{align}
    \frac{d\mu(x)}{dx} 
       &= \mu(x)\left(\frac{x}{1+x^2}\right)\\[1ex]
    \iff\int\frac{d\mu(x)}{\mu(x)}
       &=\int\left(\frac{x}{1+x^2}\right)\,dx
\end{align}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .