# Integral (integrate)

Antiderivative of an expression, or its definite integral over a range.

With this function, the solver shows the steps whenever it finds them.

## How to write it

### integrate(f, x)

The indefinite integral: an antiderivative.

**f**

The expression or function to work on. Takes an expression.

**x**

The variable of integration. Takes a variable.

### integrate(f, x = a..b)

The definite integral over the range.

**f**

The expression or function to work on. Takes an expression.

**x = a..b**

The variable and its bounds; a bound may be inf. Takes a variable with its range.

### integrate(f, x = a..b, y = a..b)

An iterated integral over two ranges.

**f**

The expression or function to work on. Takes an expression.

**x = a..b**

The first variable and its bounds. Takes a variable with its range.

**y = a..b**

The second variable and its bounds. Takes a variable with its range.

## Examples

- $\displaystyle \int x^{2} \, dx = \frac{x^{3}}{3} + C$

  `integrate(x^2, x)`

  In the solver, `integrate(x^2, x)` gives `x^3/3`.

  [Open in the solver](https://hilberon.com/?q=integrate%28x%5E2%2C%20x%29)
- $\displaystyle \int x \sin(x) \, dx = \sin(x)-x \cos(x) + C$

  `integrate(x*sin(x), x)`

  In the solver, `integrate(x*sin(x), x)` gives `sin(x) - x*cos(x)`.

  [Open in the solver](https://hilberon.com/?q=integrate%28x*sin%28x%29%2C%20x%29)
- $\displaystyle \int_{0}^{1} x^{2} \, dx = \frac{1}{3}$

  `integrate(x^2, x = 0..1)`

  In the solver, `integrate(x^2, x = 0..1)` gives `1/3`.

  [Open in the solver](https://hilberon.com/?q=integrate%28x%5E2%2C%20x%20%3D%200..1%29)
- $\displaystyle \int_{-\infty}^{\infty} e^{-x^{2}} \, dx = \sqrt{\pi}$

  `integrate(exp(-x^2), x = -inf..inf)`

  In the solver, `integrate(exp(-x^2), x = -inf..inf)` gives `sqrt(pi)`.

  [Open in the solver](https://hilberon.com/?q=integrate%28exp%28-x%5E2%29%2C%20x%20%3D%20-inf..inf%29)
- $\displaystyle \int_{0}^{1} \int_{0}^{1} (x^{2}+y) \, dy \, dx = \frac{5}{6}$

  `integrate(x^2 + y, x = 0..1, y = 0..1)`

  In the solver, `integrate(x^2 + y, x = 0..1, y = 0..1)` gives `5/6`.

  [Open in the solver](https://hilberon.com/?q=integrate%28x%5E2%20%2B%20y%2C%20x%20%3D%200..1%2C%20y%20%3D%200..1%29)

## Functions its examples use

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

  Sine of an angle in radians.
- [exp](https://hilberon.com/library/exp)

  Exponential function; exp(x) is the power e^x.

## Related functions

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

  Approximate a definite integral numerically.
- [jacobian](https://hilberon.com/library/jacobian)

  Jacobian matrix of a list of expressions: their partial derivatives.
- [hessian](https://hilberon.com/library/hessian)

  Hessian matrix of an expression: its second partial derivatives.
- [laplacian](https://hilberon.com/library/laplacian)

  Laplacian of an expression: the sum of its second partial derivatives.
- [grad](https://hilberon.com/library/grad)

  Gradient of an expression: the list of its partial derivatives.
- [limit](https://hilberon.com/library/limit)

  Limit of an expression as a variable approaches a point.

---
Source: https://hilberon.com/library/integrate
