# 极限（Limit，limit）

当变量趋近于某一点时表达式的极限。

使用这个函数时，求解器只要找到步骤就会展示。

## 怎么写

### limit(f, x = a)

x 趋近于 a 时的极限。

**f**

要处理的表达式或函数。接受一个表达式。

**x = a**

变量及其趋近的点；该点可以是 inf。接受被赋值的变量。

### limit(f, x = a, direction = left|right)

从该点一侧趋近时的极限。

**f**

要处理的表达式或函数。接受一个表达式。

**x = a**

变量及其趋近的点。接受被赋值的变量。

**direction = left|right**

从哪一侧逼近：左或右。接受left或right。

## 示例

- $\displaystyle \lim_{x \to 0} \frac{\sin(x)}{x} = 1$

  `limit(sin(x)/x, x = 0)`

  在求解器中，`limit(sin(x)/x, x = 0)` 的结果是 `1`。

  [在求解器中打开](https://zh.hilberon.com/?q=limit%28sin%28x%29%2Fx%2C%20x%20%3D%200%29)
- $\displaystyle \lim_{x \to \infty} \left(1+\frac{1}{x}\right)^{x} = e$

  `limit((1 + 1/x)^x, x = inf)`

  在求解器中，`limit((1 + 1/x)^x, x = inf)` 的结果是 `e`。

  [在求解器中打开](https://zh.hilberon.com/?q=limit%28%281%20%2B%201%2Fx%29%5Ex%2C%20x%20%3D%20inf%29)
- $\displaystyle \lim_{x \to 0^{+}} \frac{1}{x} = \infty$

  `limit(1/x, x = 0, direction = right)`

  在求解器中，`limit(1/x, x = 0, direction = right)` 的结果是 `inf`。

  [在求解器中打开](https://zh.hilberon.com/?q=limit%281%2Fx%2C%20x%20%3D%200%2C%20direction%20%3D%20right%29)

## 示例中用到的函数

- [sin](https://zh.hilberon.com/library/sin)

  角度的正弦，角度以弧度计。

## 相关函数

- [numeric_integrate](https://zh.hilberon.com/library/numeric_integrate)

  用数值方法近似计算定积分。
- [laplacian](https://zh.hilberon.com/library/laplacian)

  表达式的 Laplace 算子：它各二阶偏导数之和。
- [residue](https://zh.hilberon.com/library/residue)

  表达式在某点的留数。
- [jacobian](https://zh.hilberon.com/library/jacobian)

  一列表达式的 Jacobi 矩阵：它们的偏导数。
- [total_diff](https://zh.hilberon.com/library/total_diff)

  表达式关于某个变量的全导数。
- [integrate](https://zh.hilberon.com/library/integrate)

  表达式的原函数，或它在某个区间上的定积分。

---
Source: https://zh.hilberon.com/library/limit
