3

I'm trying to obtain something similar to: enter image description here

with the following code, using amsmath package:

\begin{equation}
\begin{split}
Q_\nu(a,b) &= \frac{1}{2}\mathrm{erfc}\left ( \frac{b+a}{\sqrt2} \right )+\frac{1}{2}\mathrm{erfc}\left ( \frac{b-a}{\sqrt2} \right )
\\
& \quad +\frac{1}{a\sqrt{2\pi}}\sum_{k=0}^{\nu-1.5}\frac{b^{2k}}{2^k}\sum_{q=0}^{k}\frac{(-1)^q(2q)!}{(k-q)!q!}
\\
& \quad \times \sum_{i=0}^{2q}\frac{1}{(ab)^{2q-i}i!}\left [ (-1)^ie^{-\frac{(b-a)^2}{2}} -e^{-\frac{(b+a)^2}{2}}\right ],
\\
a> 0,\; \; \; \; \; \;b\geq 0
\end{split}
\end{equation}

but I am getting the following:

enter image description here

Is there any code that would permit to right align the last line?

1
  • 5
    Wouldn't it be more useful for the reader if where $a>0 and $b\geq 0$. was added as text after the equation.
    – daleif
    Aug 19, 2015 at 13:49

3 Answers 3

7

yet another answer, taking advantage of some additional possibilities from mathools:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{equation}
\begin{alignedat}{2}
Q_\nu(a,b) &= \frac{1}{2}\mathrm{erfc}\left ( \frac{b+a}{\sqrt2} \right )+\frac{1}{2}\mathrm{erfc}\left ( \frac{b-a}{\sqrt2} \right )
\\
& \quad +\frac{1}{a\sqrt{2\pi}}\sum_{k=0}^{\nu-1.5}\frac{b^{2k}}{2^k}\sum_{q=0}^{k}\frac{(-1)^q(2q)!}{(k-q)!q!}
\\
& \quad \times \sum_{i=0}^{2q}\frac{1}{(ab)^{2q-i}i!}\left [ (-1)^ie^{-\frac{(b-a)^2}{2}} -e^{-\frac{(b+a)^2}{2}}\right ],
\\
&& \mathllap{ a> 0, \quad b\geq 0 }
\end{alignedat}
\end{equation}

\end{document}

enter image description here

(nonetheless, the suggestion by @daleif, to add where $a>0 and $b\geq 0$, makes the best sense.)

1

The following is close to what is being sought.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
Q_{\nu}(a,b) &= \frac{1}{2} \, \mathrm{erfc}\left( \frac{b+a}{\sqrt2} \right) + \frac{1}{2} \, \mathrm{erfc}\left( 
\frac{b-a}{\sqrt2} \right) \nonumber \\
& \quad + \frac{1}{a\sqrt{2\pi}} \, \sum_{k=0}^{\nu-\frac{3}{2}} \frac{b^{2k}}{2^k} \, \sum_{q=0}^{k}\frac{(-1)^q(2q)!}
{(k-q)!q!} \nonumber \\
& \quad \times \sum_{i=0}^{2q} \frac{1}{(ab)^{2q-i}i!} \, \left[ (-1)^ie^{-\frac{(b-a)^2}{2}} -e^{-\frac{(b+a)^2}{2}}
\right ], \nonumber \\
& \hspace{45mm} a > 0, \quad b \geq 0
\end{align}

\end{document}
1

A different solution:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{multline}
Q_{\nu}(a,b) = \frac{1}{2} \, \mathrm{erfc}\left( \frac{b+a}{\sqrt2} \right) + \frac{1}{2} \, \mathrm{erfc}\left( 
\frac{b-a}{\sqrt2} \right)\\
 \quad + \frac{1}{a\sqrt{2\pi}} \, \sum_{k=0}^{\nu-\frac{3}{2}} \frac{b^{2k}}{2^k} \, \sum_{q=0}^{k}\frac{(-1)^q(2q)!}
{(k-q)!q!}  \\
 \quad \times \sum_{i=0}^{2q} \frac{1}{(ab)^{2q-i}i!} \, \left[ (-1)^ie^{-\frac{(b-a)^2}{2}} -e^{-\frac{(b+a)^2}{2}}
\right ], \\
 a > 0, \quad b \geq 0
\end{multline}

\end{document}

You must log in to answer this question.

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