## LaTeX forum ⇒ Text Formatting ⇒ Showing error - in equationarray -

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
sachinrajsharma
Posts: 35
Joined: Sun Apr 08, 2012 5:48 am

### Showing error - in equationarray -

Hi,
Good Day!

I have been trying the following source code but unable to get the output showing error " missing \endgroup inserted"

$$\begin{eqnarray*}\int_{0}^{\pi /2}f(x)dx &=&\int_{0}^{\pi /2}\sin ^{7}x\cos ^{5}xdx \\&=&\int_{0}^{\pi /2}\sin ^{7}x\cdot \cos xdx-2\int_{0}^{\pi /2}\sin^{9}x\cdot \cos xdx \\&&+\int_{0}^{\pi /2}\sin ^{11}x\cdot \cos xdx \\&=&\frac{1}{8}-2\cdot \frac{1}{10}+\frac{1}{12}=\frac{1}{120}.\end{eqnarray*}$$

Please guide how to resolve this.

Regards,

Sachin Sharma
Last edited by cgnieder on Wed May 15, 2013 11:28 am, edited 1 time in total.

Tags:

Johannes_B
Site Moderator
Posts: 4109
Joined: Thu Nov 01, 2012 4:08 pm
Please, always provide a compilable and complete Minimal Working Example using the code-button. This makes testing much easier.

are TeX-Syntax and not to be used with LaTeX. The right expression would be $E = mc^2$. The environment equationarray is not used anymore, use align instead. \documentclass{scrartcl} \usepackage{mathtools} \begin{document}\begin{align}\int_{0}^{\pi /2}f(x)dx &=&\int_{0}^{\pi /2}\sin ^{7}x\cos ^{5}xdx \\&=&\int_{0}^{\pi /2}\sin ^{7}x\cdot \cos xdx-2\int_{0}^{\pi /2}\sin^{9}x\cdot \cos xdx \\&&+\int_{0}^{\pi /2}\sin ^{11}x\cdot \cos xdx \\&=&\frac{1}{8}-2\cdot \frac{1}{10}+\frac{1}{12}=\frac{1}{120}.\end{align}\end{document}  The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary. cgnieder Site Moderator Posts: 1990 Joined: Sat Apr 16, 2011 7:27 pm I like to repeat: {eqnarray} really should be avoided. Also, ... is plain TeX syntax and should not be used in a LaTeX document.

The &=& is {eqnarray} syntax and doesn't hold for {align} which uses &= instead. Also the splitted line beginning with + should at least be indented with \quad:

\documentclass{scrartcl} \usepackage{mathtools} \begin{document} \begin{align*}   \int_{0}^{\pi /2}f(x)dx     &= \int_{0}^{\pi /2} \sin ^{7}x \cos^{5}xdx \\     &= \int_{0}^{\pi /2} \sin ^{7}x \cdot \cos xdx - 2\int_{0}^{\pi /2}\sin^{9}x \cdot \cos xdx \\     &\quad +\int_{0}^{\pi /2}\sin ^{11}x\cdot \cos xdx \\     &= \frac{1}{8} - 2\cdot \frac{1}{10} + \frac{1}{12} \\     &= \frac{1}{120}.\end{align*} \end{document}

I would also recommend to take a look at mathmode, a document by Herbert Voß which explains many details about math mode and the various environments available.

Regards
site moderator & package author