# \eval

Marks evaluation of an expression at bounds, especially in calculus or physics notation such as applying |_a^b to an antiderivative or intermediate result.

https://texform.dev/latex/commands/eval

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Physics: quantities](https://texform.dev/latex/topics/physics-quantities) |
| Packages | physics |
| Allowed mode | math |
| Tags |  |
| Commonality | low |
| Kind | prefix |

## Syntax

### physics

Argument specification: `s d<(,|><[,|><{,}>`

Marks evaluation of an expression at bounds, especially in calculus or physics notation such as applying |_a^b to an antiderivative or intermediate result.

## Examples

```latex
\eval_0^1
```

[Open in Playground](https://play.texform.dev/?input=%5Ceval_0%5E1)

```latex
\eval*{x}_0^1
```

[Open in Playground](https://play.texform.dev/?input=%5Ceval*%7Bx%7D_0%5E1)

```latex
\eval(y|_0^1
```

[Open in Playground](https://play.texform.dev/?input=%5Ceval%28y%7C_0%5E1)

```latex
\eval*[z|_0^1
```

[Open in Playground](https://play.texform.dev/?input=%5Ceval*%5Bz%7C_0%5E1)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| physics | full | none | full |

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

### Expands to (physics)

```latex
\eval{#1}
```

→

```latex
\left.#1\vphantom{\int}\right|
```

The source also rewrites the bare form to \left.\vphantom{\int}\right|, and the starred braced form uses \smash{#1}. The ( ... | and [ ... | forms are handled via an auto-open stack item rather than string replacement.

### [physics/eval-expand](https://texform.dev/rules/physics/eval-expand)

Expand eval notation to the explicit fence-and-bar form.

Level: faithful. Fidelity: render.

```latex
\eval{#1}#2
```

→

```latex
\left.#1\vphantom{\int}\right|#2
```

```latex
\eval{\frac{x^2}{2}}_0^1=\frac{1}{2}
```

→

```latex
\left.\frac{x^2}{2}\vphantom{\int}\right|_0^1=\frac{1}{2}
```

## Equivalent forms

```latex
\evaluated{#1}
```

exact. Alias from the same physics command map; the same bare, starred, braced, and ( ... | / [ ... | forms apply after replacing the command name.

## See also

- [\\evaluated](https://texform.dev/latex/commands/evaluated)

## Test cases

### physics

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \eval | Positive: baseline | Pass | Fail | Pass |
| \eval* | Positive: vary:s[0] | Pass | Fail | Pass |
| \eval (a\| | Positive: vary:d[1] | Pass | Fail | Pass |
| \eval*(a\| | Positive: maximal | Pass | Fail | Pass |
