2

I am trying to align the 2 equals signs and the minus sign at the beginning of each line of the following code, but no matter what I do, it won't work.

$C_{n}$  = $ \dfrac{1}{4\pi{i}} $ $ \displaystyle\int^\pi_{-\pi} x^2e^{ix({1-n})}\ dx $ $ - \dfrac{1}{4\pi{i}} $ $ \displaystyle\int^\pi_{-\pi} x^2e^{{-ix}({1+n})}\ dx $ 

\bigskip $  = \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n-1)x}}{n-1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac{2xie^{-i(n-1)x}}{n-1} \ dx \Bigg] $  

\bigskip $  - \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n+1)x}}{n+1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac {2xie^{-i(n+1)x}} {n+1} \ dx \Bigg] $
3

There are probably better ways to do this, by completely restructuring your answer in terms of an align environment (see below), but this answer has the least "impact" on your original attempt. In essence, I add a \phantom to the beginning of the 2nd and 3rd lines.

\documentclass{letter}
\usepackage{amsmath}
\begin{document}
$C_{n}$  = $ \dfrac{1}{4\pi{i}} $ $ \displaystyle\int^\pi_{-\pi} x^2e^{ix({1-n})}\ dx $ $ - \dfrac{1}{4\pi{i}} $ $ \displaystyle\int^\pi_{-\pi} x^2e^{{-ix}({1+n})}\ dx $ 

\bigskip $\phantom{C_{n}}  = \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n-1)x}}{n-1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac{2xie^{-i(n-1)x}}{n-1} \ dx \Bigg] $  

\bigskip $\phantom{C_{n}}  - \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n+1)x}}{n+1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac {2xie^{-i(n+1)x}} {n+1} \ dx \Bigg] $
\end{document}

enter image description here


Here is a way to do it with align:

\documentclass{letter}
\usepackage{amsmath}
\begin{document}
\begin{align}
C_{n} &=  \dfrac{1}{4\pi{i}}  \displaystyle\int^\pi_{-\pi} x^2e^{ix({1-n})}\ dx  - \dfrac{1}{4\pi{i}}  \displaystyle\int^\pi_{-\pi} x^2e^{{-ix}({1+n})}\ dx 
\\[2ex]
&= \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n-1)x}}{n-1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac{2xie^{-i(n-1)x}}{n-1} \ dx \Bigg]  
\\[2ex]
&- \dfrac{1}{4\pi i}\Bigg[ \bigg[\dfrac {x^2ie^{-i(n+1)x}}{n+1} \bigg]_{-\pi}^\pi -  \displaystyle\int^\pi_{-\pi} \dfrac {2xie^{-i(n+1)x}} {n+1} \ dx \Bigg]
\end{align}
\end{document}

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.