# Can't wrap integral equation

I am attempting to wrap the following integral equation, but get the following error:

"Missing } inserted"

Here's the code:

\begin{align*}
\phi_{net}=$$\int_{\theta=0}^{\theta=\theta_{max}}\int_{\alpha=\alpha_{min} }^{\alpha=\alpha_{max}} aE_{s}\cos(sin(\alpha_{s})*\\ sin(\alpha)*cos(\theta_{s}-\theta) + cos(\theta_{s}-\theta)\\ + cos(\alpha_{s})*cos(\alpha)) +eM)\cos(\alpha)\\ *sin(\theta)*d\alpha*d\theta*R_{e}^2/(r^2\pi) d\alpha*d\theta$$
\end{align*}

• Delete twice  (they're superfluous since you are already in math mode). Also, please use \sin and \cos instead of just sin and cos. – Gonzalo Medina Aug 19 '15 at 18:46
• The math looks a little obscure, two integrals but two times d\alpha d\theta. – Heiko Oberdiek Aug 19 '15 at 19:17

In your case is better to use multline environment instead align:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
\phi_{net}
= \int_{\theta=0}^{\theta=\theta_{\max}}
\int_{\alpha=\alpha_{\min}}^{\alpha=\alpha_{\max}}
\bigl(aE_{s}\cos(sin(\alpha_{s})
\\
*\sin(\alpha)*\cos(\theta_{s}-\theta) + \cos(\theta_{s}-\theta)
\\
+ \cos(\alpha_{s})*\cos(\alpha))+eM)*\cos(\alpha)
\\
*\sin(\theta)\bigr)
*d\alpha*d\theta*R_{e}^2/(r^2\pi) d\alpha*d\theta
\end{multline*}

or

\begin{multline*}
\phi_{net}
= \int_{0}^{\theta_{\max}}
\int_{\alpha_{\min}}^{\alpha_{\max}}
\bigl(aE_{s}\cos(sin(\alpha_{s})\sin(\alpha)\cos(\theta_{s}-\theta)
\\
+\cos(\theta_{s}-\theta) + \cos(\alpha_{s})\cos(\alpha))+eM)
\cos(\alpha)\sin(\theta)\bigr)\, d\alpha\, d\theta\ R_{e}^2/(r^2\pi)\, d\alpha\, d\theta
\end{multline*}
\end{document}


which gives:

In second example I change notation of integral limits and drop * as multiplication symbol (this is usual writing of equations). Otherwise in for your example is essential above comments.

• I just just like to note that the operators (+ and *) should be at the beginning of the next line rather than at the end of the preceding one. At if you still insist, you rather type it as \cos(\theta_s-\theta)+{} (note the empty braces) so that you get the proper spacing. – yo' Aug 19 '15 at 19:26
• @yo', you are right, it seems that I lost in editing the equations. I will correct this. – Zarko Aug 19 '15 at 19:30
• @yo' That depends. If I recall correctly, Russians tend to use the operators before the line break. – Gonzalo Medina Aug 19 '15 at 19:35
• @GonzaloMedina That's why the comment has the 2nd sentence, because amsmath didn't consider this... – yo' Aug 19 '15 at 20:30
• @yo' I somehow missed that second sentence. Ignore my comment. – Gonzalo Medina Aug 19 '15 at 21:14

The math doesn't look quite right. For sure, there's one opening parenthesis missing. The following code inserts a \Big\{ directive at the start of the integrand and changes the orphaned ) to \Bigr\}. However, this opening "fence" may be better placed after the aE_{s} term.

To save quite a bit of space, consider getting rid of most pairs of parentheses around the arguments of \sin and\cosas well as all of instances of*. Still more space can be saved by placing the limits of integration above and below the integral symbols instead of off to the right. This may be achieved either by passing the optionintlimitsto theamsmathpackage -- as is done in the code below -- or by inserting\limits*after*\int.

Not sure what to do about the doubled variables of integration.

\documentclass{article}
\usepackage[intlimits]{amsmath}

\begin{document}
\hrule  % just to illustrate width of text block
\begin{align*}
\phi_{\textrm{net}}=\smash[b]{\int_{\theta=0}^{\theta_{\max}}
\int_{\alpha=\alpha_{\min}}^{\alpha_{\max}}} &
\Bigl\{aE_{s}\cos\bigl[\sin\alpha_{s}\sin\alpha\cos(\theta_{s}-\theta) + \cos(\theta_{s}-\theta)\\

• please add \, between d\alpha d\theta`. (i'm sure this is recommended in the texbook, but didn't check.) – barbara beeton Aug 19 '15 at 20:18