[Tex/LaTex] How to break a long equation

equationsline-breaking

I have a long equation that it was hard for me to break so that it appears professional. How can I do it?

\begin{equation}
    \begin{split}
        &\mathbb{P}\left( \left. Z_{1}\in dx_{1},Z_{2}\in dx_{2},\cdots ,Z_{n}\in
            dx_{n}\right\vert Z_{n+1}=x_{n+1}\right) \\
        \qquad &=f_{Z_{n+1}}\left(x_{n+1}\right) ^{-1}\left[ \mathbb{P}\left( \left\{ Z_{1}\in dx_{1},Z_{2}\in
            dx_{2},\cdots ,Z_{n}\in dx_{n}\right\} \cap \left\{ Z_{n+1}=x_{n+1}\right\} \right) \right]  \\
        =f_{Z_{n+1}}\left( x_{n+1}\right) ^{-1}\times \mathbb{\pi } \\
        =e^{-x_{n+1}}dx_{1}\cdots dx_{n+1}/f_{Z_{n+1}}\left( x_{n+1}\right)  \\
        =n!x^{-n}dx_{1}\cdots dx_{n}
    \end{split}
\end{equation}

Best Answer

You're not far. Remove all \left and \right tokens that only do bad, in this context; there's just a pair of brackets that asks for being a bit larger (with \bigl and \bigr).

Also some help is needed for the dots in the final two lines; use \mid instead of \vert, for better spacing and don't forget \, after the factorial.

Last thing: I added empty superscripts to f_{Z_{n+1}}, so the subscript is slightly moved down.

\documentclass{article}
\usepackage{mathtools}
\usepackage{amsfonts} % for \mathbb

\DeclareMathOperator{\PR}{\mathbb{P}}

\begin{document}
\begin{equation}
\begin{split}
&\PR(Z_{1}\in dx_{1},Z_{2}\in dx_{2},\dots ,Z_{n}\in dx_{n}\mid Z_{n+1}=x_{n+1})
\\
&\quad =f^{}_{Z_{n+1}}(x_{n+1}) ^{-1}\bigl[
   \PR( \{ Z_{1}\in dx_{1},Z_{2}\in dx_{2},\dots,Z_{n}\in dx_{n}\}
\\
&\qquad\qquad \cap\{Z_{n+1}=x_{n+1}\})\bigr]  \\
&\quad =f^{}_{Z_{n+1}}( x_{n+1}) ^{-1}\times \pi \\
&\quad =e^{-x_{n+1}}dx_{1}\dotsm dx_{n+1}/f^{}_{Z_{n+1}}(x_{n+1})  \\
&\quad =n!\,x^{-n}dx_{1}\dotsm dx_{n}
\end{split}
\end{equation}
\end{document}

enter image description here