FLINT3.7.0-dev

acb_hypgeom_legendre_q

Synopsis#include <flint/acb_hypgeom.h>
void acb_hypgeom_legendre_q(acb_t res, const acb_t n, const acb_t m, const acb_t z, int type, slong prec)source

Sets res to the associated Legendre function of the second kind of degree n, order m and argument z; for m = 0 this is the Legendre function Q_n(z). If type is 0, the function is

Q_n^m(z) = \frac{\pi}{2 \sin(\pi m)} \left( \cos(\pi m) P_n^m(z) - \frac{\Gamma(1+m+n)}{\Gamma(1-m+n)} P_n^{-m}(z)\right),

and if type is 1,

\mathcal{Q}_n^m(z) = \frac{\pi}{2 \sin(\pi m)} e^{\pi i m} \left( \mathcal{P}_n^m(z) - \frac{\Gamma(1+m+n)}{\Gamma(1-m+n)} \mathcal{P}_n^{-m}(z)\right).

Type 0 and type 1 correspond to type 2 and type 3 in Mathematica and mpmath; other values of type raise an exception.

For integer m either expression is interpreted as a limit. The connection formulas [WQ3a], [WQ3b] and [WQ3c] make it possible to compute the function also in the limiting case. (The formula [WQ3d] would be useful too, but it is incorrect in the lower half-plane.)

References#

Cite this page

The FLINT team, “acb_hypgeom_legendre_q (acb_hypgeom.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb_hypgeom/acb_hypgeom_legendre_q.html (generated 2026-10-20).