# Splitting and aligning equation (long on both sides)

I would like to split and align an equation which is really long on both sides.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
& 2\sin(x - w)\sin(y - z) + 2\sin(y - w)\sin(z - x) + 2\sin(z - w)\sin(x - y)\\
\begin{split}
={} & \cos(x + z - y - w) - \cos(x + y - z - w) + \cos (x + y - z - w) - \cos(y + z - x - w)\\
& + \cos(y + z - x - w) - \cos(x + z - y - w)
\end{split}\\
={} & 0
\end{align*}
\end{document}


When I run the code, I get the following output. The problem is that I want the '2' to align with the rest of the '='s. I also want the '+' in the third line to stay how it is right now (i.e. not aligned with the rest of the '='s.) How can I do this?

Welcome to TeX.SE!

With use of instruction \MoveEqLeft and environment \multlined, defined in the mathtools package macro's you can write your equations as follows:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
\MoveEqLeft
2\sin(x - w)\sin(y - z) + 2\sin(y - w)\sin(z - x) + 2\sin(z - w)\sin(x - y)\\
& = \begin{multlined}[t]
\cos(x + z - y - w) - \cos(x + y - z - w) + \cos (x + y - z - w)\\
- \cos(y + z - x - w) + \cos(y + z - x - w) - \cos(x + z - y - w)
\end{multlined} \\
& = 0
\end{align*}
\end{document} • Thank you so much! I was struggling with this for too long :( Jul 26 at 8:02
• @radiuszero, you are welcome! Happy TeX-ing! Jul 26 at 8:37