3

Here's what I'm trying to achieve:

enter image description here

Here's my MWE:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\displaystyle\int_{-a}^{+a}f(x)e^{-i\frac{n\pi x}{a}}\; dx = \sum_{n=-\infty}^{+\infty}c_n\int_{-a}^{+a}e^{i(n-m)\frac{\pi x}{a}}\; dx = \\
\text{for } n \neq m: \quad \int_{-a}^{+a}e^{-i\frac{n\pi x}{a}}\; dx 
\begin{split}
&=  \left[\frac{e^{i(n-m)\frac{\pi x}{a}}}{i(n-m)\frac{\pi}{a}}\right]^{+a}_{-a} = \frac{e^{i(n-m)\pi}-e^{-i(n-m)\pi}}{i(n-m)\frac{\pi}{a}}\\
&=\frac{(-1)^{n-m}-(-1)^{n-m}}{i(n-m)\frac{\pi}{a}} = 0
\end{split}\\
\text{for } n   =  m: \quad \int_{-a}^{+a}e^{-i\frac{n\pi x}{a}}\; dx
\end{align*}
\end{document}

enter image description here

  • Not \begin{split}, but \begin{aligned}[t]. Remove \displaystyle that doesn nothing at all. The space before the differential should be \, and not \;. – egreg Sep 17 '15 at 22:36
1

With some improvements:

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

\begin{align*}
&\int_{-a}^{+a}f(x)e^{-i\frac{n\pi x}{a}}\, dx
  = \sum_{n=-\infty}^{+\infty}c_n\int_{-a}^{+a}e^{i(n-m)\frac{\pi x}{a}}\, dx\\
&\text{for $n \neq m$:} \quad \int_{-a}^{+a}e^{-i\frac{n\pi x}{a}}\, dx
\begin{aligned}[t]
&=  \left[\frac{e^{i(n-m)\frac{\pi x}{a}}}{i(n-m)\frac{\pi}{a}}\right]^{+a}_{-a} = 
    \frac{e^{i(n-m)\pi}-e^{-i(n-m)\pi}}{i(n-m)\frac{\pi}{a}}\\
&=\frac{(-1)^{n-m}-(-1)^{n-m}}{i(n-m)\frac{\pi}{a}} = 0
\end{aligned}\\
&\text{for $n=m$:} \quad \int_{-a}^{+a}e^{-i\frac{n\pi x}{a}}\, dx = \int_{-a}^a dx = 2a
\end{align*}

\end{document}

The trick is aligned with the [t] specifier.

enter image description here

  • Excellent! Thanks for the improvements too - all duly noted. – Bailey Sep 17 '15 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.