# Documentation

## Compute Right and Left Limits

 Note:   Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB.

If a limit of a function at a particular value of a variable does not exist, the `limit` command returns `undefined`. For example, `tan(x)` does not have a bidirectional limit at :

`limit(tan(x), x = PI/2)`

The plot of this function shows that the function can have two different limits as the variable `x` approaches the value from the left and from the right:

`plot(tan(x), x = -PI..PI)`

To compute one-sided limits of a function, use the options `Left` and `Right`:

```limit(tan(x), x = PI/2, Left); limit(tan(x), x = PI/2, Right)```

If the function has a bidirectional limit at some point, one-sided limits are equal at this point. They also are equal to the bidirectional limit at this point:

```Left = limit(abs(tan(x)), x = PI/2, Left); Right = limit(abs(tan(x)), x = PI/2, Right); Bidirectional = limit(abs(tan(x)), x = PI/2)```

`plot(abs(tan(x)), x = 0..PI)`