orthax.legendre.legmulx

orthax.legendre.legmulx(c, mode='full')Source

Multiply a Legendre series by x.

Multiply the Legendre series c by x, where x is the independent variable.

Parameters:
  • c (array_like) – 1-D array of Legendre series coefficients ordered from low to high.

  • mode ({"full", "same"}) – If “full”, output has shape (len(c) + 1). If “same”, output has shape (len(c)), possibly truncating high order modes.

Returns:

out (ndarray) – Array representing the result of the multiplication.

See also

legadd, legmul, legdiv, legpow

Notes

The multiplication uses the recursion relationship for Legendre polynomials in the form

\[xP_i(x) = ((i + 1)*P_{i + 1}(x) + i*P_{i - 1}(x))/(2i + 1)\]

Examples

>>> from orthax import legendre as L
>>> L.legmulx([1,2,3])
array([ 0.66666667, 2.2, 1.33333333, 1.8]) # may vary