# \grad

Used to denote the gradient operator, either before a following expression or with an immediately following (), [], or braced application.

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

## Metadata

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

## Syntax

### physics

Argument specification: `d<(,)><[,]><{,}>`

Used to denote the gradient operator, either before a following expression or with an immediately following (), [], or braced application.

## Examples

```latex
\grad x
```

[Open in Playground](https://play.texform.dev/?input=%5Cgrad+x)

```latex
\grad(x)
```

[Open in Playground](https://play.texform.dev/?input=%5Cgrad%28x%29)

```latex
\grad[x]
```

[Open in Playground](https://play.texform.dev/?input=%5Cgrad%5Bx%5D)

```latex
\grad{f}
```

[Open in Playground](https://play.texform.dev/?input=%5Cgrad%7Bf%7D)

## 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.

## Equivalent forms

```latex
\gradient
```

exact. Alias mapped to the same parse method with the same operator and fence list.

## See also

- [\\gradient](https://texform.dev/latex/commands/gradient)
- [\\Im](https://texform.dev/latex/commands/Im)
- [\\laplacian](https://texform.dev/latex/commands/laplacian)
- [\\principalvalue](https://texform.dev/latex/commands/principalvalue)
- [\\pv](https://texform.dev/latex/commands/pv)
- [\\PV](https://texform.dev/latex/commands/PV)
- [\\Re](https://texform.dev/latex/commands/Re)
- [\\Res](https://texform.dev/latex/commands/Res)

## Test cases

### physics

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \grad | Positive: baseline | Pass | Fail | Pass |
| \grad (a) | Positive: vary:d[0] | Pass | Fail | Pass |
