Ask Your Question

Revision history [back]

No need to define a symbolic variable like u in your example.

The following should be what you want.

sage: D = RealDistribution('gaussian', 1)
sage: f = D.distribution_function
sage: def prob(a, b):
....:     return integral_numerical(f, (a, b))
....: 
sage: prob(1.4, 1.5)
(0.013949457964912993, 1.5487009413687183e-16)

where the output is an estimation of the integral and of the error term in computing it numerically.