This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / special / _orthogonal / roots_jacobi

function

scipy.special._orthogonal:roots_jacobi

source: build-install/usr/lib/python3.14/site-packages/scipy/special/_orthogonal.py:246

Signature

def roots_jacobi(n, alpha, beta, mu = False)

Summary

Gauss-Jacobi quadrature.

Extended Summary

Compute the sample points and weights for Gauss-Jacobi quadrature. The sample points are the roots of the nth degree Jacobi polynomial, . These sample points and weights correctly integrate polynomials of degree or less over the interval with weight function . See 22.2.1 in [AS] for details.

Parameters

n : int

Quadrature order.

alpha : float

alpha must be > -1.

beta : float

beta must be > -1.

mu : bool, optional

If True, return the sum of the weights in addition to sample points and weights.

Returns

x : ndarray

Sample points.

w : ndarray

Weights.

mu : float, optional

Sum of the weights, only returned if mu=True.

Examples

from scipy.special import roots_jacobi
x, w = roots_jacobi(3, 0.5, 0.5)
✓
x
w
✗
array([0.393, 0.785, 0.393])
x, w, mu = roots_jacobi(3, 0.5, 0.5, mu=True)
✓
mu
✗
np.float64(1.5707963267948963)

See also

scipy.integrate.fixed_quad

Aliases

  • scipy.special.j_roots

Referenced by