$$\left. x + \cos x\right|_a^b$$

Code:

`$$\left. x + \cos x\right|_a^b$$`

$$\left. x + \frac{x^2}{2}\right|_a^b$$

Code:

`$$\left. x + \frac{x^2}{2}\right|_a^b$$`

It works for any type of bracket.

$$\left. \begin{aligned} x+y&=3 \\ x-y&=1 \end{aligned} \right\} \implies \left\{ \begin{aligned} x &= 2 \\ y &= 1\end{aligned} \right.$$

Code:

```
$$\left.
\begin{aligned} x+y&=3 \\ x-y&=1 \end{aligned}
\right\} \implies \left\{
\begin{aligned} x &= 2 \\ y &= 1\end{aligned}
\right.$$
```

\left \right pairs must be matched.