0
\begin{align*}
f_{y_1,y_2} (y_1,y_2) &= f__{X_1,X_2}(y_1, \frac{(1-y_1)}{2} - \sqrt{ \frac{y_2}{2} -\frac{{y_1}^{2}}{2} - \frac{(1-y_1)^{2}}{4}} ) \abs {J_1} 
 + f__{X_1,X_2}(y_1, \frac{(1-y_1)}{2} + \sqrt{ \frac{y_2}{2} -\frac{{y_1}^{2}}{2} - \frac{(1-y_1)^{2}}{4}} ) \abs {J_2}  \\
f_{y_1,y_2} (y_1,y_2) & =  \frac{\Gamma(\alpha_1 +\alpha_2)}{\Gamma(\alpha_1) \Gamma(\alpha_2)} \vast[ (\frac{(1-y_1)}{2} - \sqrt{R})^{\alpha_2 -1} + ( \frac{(1-y_1)}{2}+ \sqrt{R})^{\alpha_2 -1} \vast]\\
\end{align*}

I do not know where the problem is. Thank you so much for your help.

  • 1
    What is the \vast command? – Bernard Apr 24 '19 at 22:54
  • @Bernard you can see here the \vast command used by JouleV with the same user MathMan12: https://tex.stackexchange.com/questions/487395/error-with-extra-or-forgotten-right/487397#487397 – Sebastiano Apr 24 '19 at 22:59

2 Answers2

1

I didn't have any problem with compilation of code snippet. After completing it to small document it works fine.

However, your first equation is to long that can be fit into text width, so I suggest to break it into two lines by using multlined math environment from mathtools package. Also for definition of \abs{...}. I would rather use macro \DeclarePairedDelimiter from the same package than define own command. It is also better to replace with Bigl(, Bigr) or \left[, right]. they are more meaningful than your defined command \vast:

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}

\begin{document}
    \begin{align*}
f_{y_1,y_2} (y_1,y_2)
    & = \begin{multlined}[t]
        f_{X_1,X_2}\left(y_1, \frac{1-y_1}{2} -
        \sqrt{\frac{y_2}{2} - \frac{y_1^2}{2} - \frac{(1-y_1)^2}{4}}\,\right) \abs{J_1} + \\
        f_{X_1,X_2}\left(y_1, \frac{1-y_1}{2} +
        \sqrt{\frac{y_2}{2} - \frac{y_1^2}{2} - \frac{(1-y_1)^2}{4}}\,\right) \abs{J_2}
        \end{multlined}\\
f_{y_1,y_2} (y_1,y_2)
    & = \frac{\Gamma(\alpha_1 +\alpha_2)}{\Gamma(\alpha_1) \Gamma(\alpha_2)}
        \left[\Bigl(\frac{(1-y_1)}{2} - \sqrt{R}\Bigr)^{\alpha_2 -1} +
        \Bigl( \frac{1-y_1}{2}+ \sqrt{R}\Bigr)^{\alpha_2 -1} \right]\\
    \end{align*}

\end{document}

result is:

enter image description here

Zarko
  • 296,517
0

Instead of __ it needs to be only a single _ (at 2 locations):

\documentclass{article}

\usepackage{mathtools}

\newcommand{\abs}[1]{#1}
\newcommand{\vast}[1]{#1}

\begin{document}

  \begin{align*}
    f_{y_1,y_2} (y_1,y_2) &= f_{X_1,X_2}(y_1, \frac{(1-y_1)}{2} - \sqrt{ \frac{y_2}{2} -\frac{{y_1}^{2}}{2} - \frac{(1-y_1)^{2}}{4}} ) \abs {J_1} 
     + f_{X_1,X_2}(y_1, \frac{(1-y_1)}{2} + \sqrt{ \frac{y_2}{2} -\frac{{y_1}^{2}}{2} - \frac{(1-y_1)^{2}}{4}} ) \abs {J_2}  \\
    f_{y_1,y_2} (y_1,y_2) & =  \frac{\Gamma(\alpha_1 +\alpha_2)}{\Gamma(\alpha_1) \Gamma(\alpha_2)} \vast[ (\frac{(1-y_1)}{2} - \sqrt{R})^{\alpha_2 -1} + ( \frac{(1-y_1)}{2}+ \sqrt{R})^{\alpha_2 -1} \vast]\\
    \end{align*}

\end{document}
  • Thank you user186389. You are awesome. When I use pdf viewer, the formula gets cut off. I do not know what do in that case. Thanks! – MathMan12 Apr 24 '19 at 23:48