def legmulx(c):
<EOL>[c] = pu.as_series([c])<EOL>if len(c) == <NUM_LIT:1> and c[<NUM_LIT:0>] == <NUM_LIT:0>:<EOL><INDENT>return c<EOL><DEDENT>prd = np.empty(len(c) + <NUM_LIT:1>, dtype=c.dtype)<EOL>prd[<NUM_LIT:0>] = c[<NUM_LIT:0>]*<NUM_LIT:0><EOL>prd[<NUM_LIT:1>] = c[<NUM_LIT:0>]<EOL>for i in range(<NUM_LIT:1>, len(c)):<EOL><INDENT>j = i + <NUM_LIT:1><EOL>k = i - <NUM_LIT:1><EOL>s = i + j<EOL>prd[j] = (c[i]*j)/s<EOL>prd[k] += (c[i]*i)/s<EOL><DEDENT>return prd<EOL>
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.

    Returns
    -------
    out : ndarray
        Array representing the result of the multiplication.

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

    .. math::

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