0

i need to include limits (lower and upper ) in the ``\middle|` to solution to an integration.

\begin{eqnarray}
 Area &=& \int_{-1}^{2}(7-x^2)dx \\
&=& \left[\left(7x-\frac{1}{3}x^3\right) \middle| \right] \\ % here is where i wish it to occur
&=& \left[7.2-\frac{1}{3}(8)\right]- \left[7(-1)-\frac{1}{3}(-1)\right] \\
&=& 18 
\end{eqnarray}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
user38064
  • 1
  • 1

1 Answers1

1

(Summary of comments.)

You can add the limits after the bracket using [...]_{lower}^{upper}. Having both brackets and bar is at best unusual, so stick to one or the other.

Also as mentioned, eqnarray should not be used, environments defined by amsmath is preferred (see eqnarray vs align). Which environment to use depends on what type of numbering you prefer. align gives you a number for each line, aligned (or split) inside an equation gives you a single number for the whole group of equations, and align* gives you no numbers at all.

I also used \text{...} for Area, and I added a thin space (\,) before dx.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Each step numbered:
\begin{align}
 \text{Area} &= \int_{-1}^{2}(7-x^2)\,dx \\
&= \left[\left(7x-\frac{1}{3}x^3\right) \right]_{-1}^{2} \\ 
&= \left[7\cdot2-\frac{1}{3}(8)\right]- \left[7(-1)-\frac{1}{3}(-1)\right] \\
&= 18 
\end{align}

One number for all:
\begin{equation}
\begin{aligned}
 \text{Area} &= \int_{-1}^{2}(7-x^2)\,dx \\
&= \left[\left(7x-\frac{1}{3}x^3\right) \right]_{-1}^{2} \\ 
&= \left[7\cdot2-\frac{1}{3}(8)\right]- \left[7(-1)-\frac{1}{3}(-1)\right] \\
&= 18 
\end{aligned}
\end{equation}

No numbers:
\begin{align*}
 \text{Area} &= \int_{-1}^{2}(7-x^2)\,dx \\
&= \left[\left(7x-\frac{1}{3}x^3\right) \right]_{-1}^{2} \\ 
&= \left[7\cdot2-\frac{1}{3}(8)\right]- \left[7(-1)-\frac{1}{3}(-1)\right] \\
&= 18 
\end{align*}
\end{document}
Torbjørn T.
  • 206,688