# Primitive and definite integral: risch

### 5.20.2 Primitive and definite integral: risch

The Risch algorithm is a powerful algorithm for finding an elementary primitive of an elementary function or concluding that one doesn’t exist. The risch command finds primitives and can use them to evaluate definite integrals.

To find a primitive:

- risch takes one mandatory argument and one optional argument:
  - expr, an expression.
  - Optionally x, the name of a variable (by default the variable is x).
- risch(expr ⟨ ,x ⟩) returns a primitive of expr with respect to x.

#### Examples.

- Input:
  risch(x^2)
  Output:

  x3
  3

- Input:
  risch(t^2,t)
  Output:

  t3
  3

- Input:
  risch(exp(-x^2))
  Output:

  ∫ | e−x2 dx

  meaning that exp(−x2) has no primitive expressed with the usual functions.

To evaluate a definite integral:

- risch takes four arguments:
  - expr, an expression expr.
  - x, the variable.
  - a and b, the bounds of the definite integral.
- int(expr,x,a,b) returns the exact value of the definite integral if the computation was successful or an unevaluated integral otherwise.

#### Example.

Input:

risch(x^2,x,0,1)

Output:

1
3