[Tex/LaTex] Parenthesis size and white space in equation with long subscripts

bracketsmath-modemathtoolsspacingsubscripts

I'm writing an equation which contains a relatively long subscritps under a summation, which is just next to a bracket. The code is the following

$$\mu_j=\E(X_j)=\E\left(
    \sum_{i\in Pa(X_j)}\lambda_{ij}X_i+W_j\right)
   =\sum_{i\in Pa(X_j)}\lambda_{ij}\mu_i+v_j.$$

With the commands \left, \right the brackets are too big and also there is too much with space between the beginning of the expression and the end of the summation. I've tried to use commands as \mathclap, \mathrlap together with \Biggl and similar in order to have a better looking equation, but I hadn't any satisfactory result. The problem is also that with these commands the alignment of the whole equation seems to decrease. Have you got any suggestions?

Best Answer

If you swap the terms inside the brackets, the brackets are less of an obstacle:

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\newcommand{\E}{\mathbb{E}}% Requires amssymb
\begin{document}
\[
  \mu_j=\E(X_j)=\E\bigg(
        W_j+\,\,\sum_{\mathclap{i\in Pa(X_j)}}\lambda_{ij}X_i\bigg)
       =\,\,\sum_{\mathclap{i\in Pa(X_j)}}\lambda_{ij}\mu_i+v_j.
\]
\end{document}

Also see Why is \[ … \] preferable to $$?

Related Question