Integral | symbol format
In this case I'd just use \Big|_{-1}^{1}
.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\int_{-1}^{1}8x^3-5x^2+4dx=\tfrac{8}{4}x^4-\tfrac{5}{3}x^3+4x\Big|_{-1}^{1}
\]
\end{document}
And here is why I don't recommend using anything similar to \left. \int_{-1}^{1}....\right|_{-1}^{1}
as then the |
with limits is actually taller than the integral which is unnecessary
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\left.\int_{-1}^{1}\right|_{1}^{-1}
\]
\end{document}
I'm not a fan of this notation, because it doesn't make clear what the evaluation should apply to.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\evalint}{%
\left.\kern-\nulldelimiterspace
\vphantom{\int}\right|%
}
\begin{document}
\[
\int_{-1}^{1}(8x^3-5x^2+4)\,dx=
\frac{8}{4}x^4-\frac{5}{3}x^3+4x\evalint_{-1}^{1}
\]
$
\int_{-1}^{1}(8x^3-5x^2+4)\,dx=
\frac{8}{4}x^4-\frac{5}{3}x^3+4x\evalint_{-1}^{1}
$
\end{document}
A different implementation that guarantees the limits to be (quite accurately, although not completely exact) at the same height as in the integral.
\documentclass{article}
\usepackage{amsmath}
\usepackage{xparse}
\makeatletter
\NewDocumentCommand{\evalint}{e{_^}}{%
\mathpalette\eval@int{{#1}{#2}}%
}
\newcommand{\eval@int}[2]{\eval@@int#1#2}
\newcommand{\eval@@int}[3]{%
\ifx#1\displaystyle\eval@@@int{#2}{#3}\else
\ifx#1\textstyle\big|_{#2}^{#3}\else
\vert_{#2}^{#3}\fi\fi
}
\newcommand{\eval@@@int}[2]{%
\left.\kern-\nulldelimiterspace
\sbox0{$\displaystyle\int_{#1}^{#2}$}\global\dimen1=\dimexpr\ht0+\dp0\relax
\vphantom{\int}%
\right|\!
\vcenter to\dimen1{\hbox{$\scriptstyle#2$}\vfill\hbox{$\scriptstyle#1$}}%
}
\makeatother
\begin{document}
\[
\int_{-1}^{1}(8x^3-5x^2+4)\,dx=
\frac{8}{4}x^4-\frac{5}{3}x^3+4x\evalint_{-1}^{1}
\]
$
\int_{-1}^{1}(8x^3-5x^2+4)\,dx=
\frac{8}{4}x^4-\frac{5}{3}x^3+4x\evalint_{-1}^{1}
$
\end{document}
With \Big as @daleif suggested, or \bigg
, and some cosmetic improvements: a correctly spaced upright d
, and medium-sized fractions for numerical coefficients:
\documentclass[ a4paper]{article}
\usepackage{nccmath}
\newcommand*{\dd}{\mathop{}\!\mathrm{d}}
\begin{document}
\[ \int_{-1}^{1}(8x^3-5x^2+4)\dd x =\mfrac{8}{4}x^4-\mfrac{5}{3}x^3+4x\bigg|_{1}^{-1} \]
\[ \int_{-1}^{1}(8x^3-5x^2+4)\dd x =\mfrac{8}{4}x^4-\mfrac{5}{3}x^3+4x\Big|_{1}^{-1} \]
\end{document}