2
\begin{equation}

\begin{aligned}
\f(\kappa,\rho,\alpha,\beta_i,X_i;x_i,y_i) & =\dfrac{\exp \big(k cos(x_i-X_i)\big)}{2\pi I_0}\dfrac{(1-\rho^2)}{2\pi\big[1+\rho^2-2\rho \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2 I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\dfrac{1}{\big[1-\dfrac{2\rho}{(1+\rho^2)} \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}\cos(y_i-\alpha-\beta_i X_i)\big]^{-1}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)} \exp \big(\cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}{\cos(y_i-\beta_i X_i) \cos\alpha+\sin(y_i-\beta_i X_i \sin\alpha)}\big]^{-1} 
\end{aligned}

\end{equation}

Where should I put the $?

13
  • 9
    remove the blank lines, you are not allowed paragraph breaks in math Feb 17 '18 at 10:57
  • 5
    unrelated but use \bigl(...\bigr) never use \big which is the internal command used to define \bigl and \bigr Feb 17 '18 at 10:58
  • what mean by blank line@D Feb 17 '18 at 10:59
  • 1
    The blank line is an empty line, with only spaces.
    – CarLaTeX
    Feb 17 '18 at 11:02
  • 1
    @DoāaY.El-borai: The empty line between \begin{aligned} and \f: you should remove it, as well as the empty line before \end{equation}.
    – GuM
    Feb 17 '18 at 11:03
4

You haven't defined the macro \f; in the code below, I've set \f equal to just f.

Since the term \frac{\exp\big(k\cos(x_i-X_i)\big)}{(2\pi)^2 I_0} occurs repeatedly, I'd like to suggest that you give it a new, compact name, say \zeta_i.

The following may then be what you're looking for; note the extra linebreak in the final row.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand\f{f} % ??
\begin{document}
Put $\zeta_i= \dfrac{\exp \bigl(k\cos(x_i-X_i)\bigr)}{(2\pi)^2 I_0}$. 
\begin{equation}
\begin{aligned}[b]
\f(\kappa,\rho,\alpha,\beta_i,X_i;x_i,y_i) 
 &= \zeta_i\,\frac{(1-\rho^2)}{\bigl[1+\rho^2-2\rho \cos(y_i-\alpha-\beta_i X_i)\bigr]}\\
 &= \frac{\zeta_i}{\lambda\rho}\,\frac{(1-\rho^2)}{(1+\rho^2)}
    \frac{1}{\bigl[1-\frac{2\rho}{(1+\rho^2)} \cos(y_i-\alpha-\beta_i X_i)\bigr]}\\
 &= \frac{\zeta_i}{\lambda\rho}\,\frac{(1-\rho^2)}{(1+\rho^2)}  
    \bigl[1-\frac{2\rho}{(1+\rho^2)}\cos(y_i-\alpha-\beta_i X_i)\bigr]^{-1}\\
 &= \frac{\zeta_i}{\lambda\rho}\,\frac{(1-\rho^2)}{(1+\rho^2)} 
    \bigl[1-\frac{2\rho}{(1+\rho^2)}\cos(y_i-\beta_i X_i) \cos\alpha\\
 &\qquad\qquad +\sin(y_i-\beta_i X_i \sin\alpha)\bigr]^{-1} 
\end{aligned}
\end{equation}
\end{document}
3

I changed your code a bit, to something that could compile:

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{aligned}
f(\kappa,\rho,\alpha,\beta_i,X_i;x_i,y_i) & =\dfrac{\exp \big(k cos(x_i-X_i)\big)}{2\pi I_0}\dfrac{(1-\rho^2)}{2\pi\big[1+\rho^2-2\rho \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2 I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\dfrac{1}{\big[1-\dfrac{2\rho}{(1+\rho^2)} \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}\cos(y_i-\alpha-\beta_i X_i)\big]^{-1}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)} \exp \big(\cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}{\cos(y_i-\beta_i X_i) \cos\alpha+\sin(y_i-\beta_i X_i \sin\alpha)}\big]^{-1} \end{aligned}
\end{equation}
\end{document}

This produces:

enter image description here

I have removed the blank lines you had inside the aligned environment, and the \f

If you really want blank lines, you need to mark them with percentage signs:

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{aligned}
%    
f(\kappa,\rho,\alpha,\beta_i,X_i;x_i,y_i) & =\dfrac{\exp \big(k cos(x_i-X_i)\big)}{2\pi I_0}\dfrac{(1-\rho^2)}{2\pi\big[1+\rho^2-2\rho \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2 I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\dfrac{1}{\big[1-\dfrac{2\rho}{(1+\rho^2)} \cos(y_i-\alpha-\beta_i X_i)\big]}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)}\exp \big(k \cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}\cos(y_i-\alpha-\beta_i X_i)\big]^{-1}\\
 & =\dfrac{1}{(2\pi)^2I_0(\lambda \rho)} \exp \big(\cos(x_i-X_i)\big)\dfrac{(1-\rho^2)}{(1+\rho^2)}\big[1-\dfrac{2\rho}{(1+\rho^2)}{\cos(y_i-\beta_i X_i) \cos\alpha+\sin(y_i-\beta_i X_i \sin\alpha)}\big]^{-1}     
%
\end{aligned}
\end{equation}
\end{document}

Edit:

I originally compiled the code above in the memoir class, but the math was too wide, which is why i changed to standalone. In the standalone class I do get an error, but this error is not present in memoir, and the document still compiles to the shown picture

3
  • i solve it by write f without \.... thanx alot Feb 17 '18 at 11:17
  • If this worked @DoāaY.El-borai then please press the tick mark under the arrows, so the question is closed :-) Feb 17 '18 at 11:22
  • cos and sin are not variable, so you should write \cos and \sin ...
    – Zarko
    Feb 17 '18 at 16:27

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.