def legmul(c1, c2):
<EOL>[c1, c2] = pu.as_series([c1, c2])<EOL>if len(c1) > len(c2):<EOL><INDENT>c = c2<EOL>xs = c1<EOL><DEDENT>else:<EOL><INDENT>c = c1<EOL>xs = c2<EOL><DEDENT>if len(c) == <NUM_LIT:1>:<EOL><INDENT>c0 = c[<NUM_LIT:0>]*xs<EOL>c1 = <NUM_LIT:0><EOL><DEDENT>elif len(c) == <NUM_LIT:2>:<EOL><INDENT>c0 = c[<NUM_LIT:0>]*xs<EOL>c1 = c[<NUM_LIT:1>]*xs<EOL><DEDENT>else:<EOL><INDENT>nd = len(c)<EOL>c0 = c[-<NUM_LIT:2>]*xs<EOL>c1 = c[-<NUM_LIT:1>]*xs<EOL>for i in range(<NUM_LIT:3>, len(c) + <NUM_LIT:1>):<EOL><INDENT>tmp = c0<EOL>nd = nd - <NUM_LIT:1><EOL>c0 = legsub(c[-i]*xs, (c1*(nd - <NUM_LIT:1>))/nd)<EOL>c1 = legadd(tmp, (legmulx(c1)*(<NUM_LIT:2>*nd - <NUM_LIT:1>))/nd)<EOL><DEDENT><DEDENT>return legadd(c0, legmulx(c1))<EOL>
Multiply one Legendre series by another.

Returns the product of two Legendre series `c1` * `c2`.  The arguments
are sequences of coefficients, from lowest order "term" to highest,
e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``.

Parameters
----------
c1, c2 : array_like
    1-D arrays of Legendre series coefficients ordered from low to
    high.

Returns
-------
out : ndarray
    Of Legendre series coefficients representing their product.

See Also
--------
legadd, legsub, legdiv, legpow

Notes
-----
In general, the (polynomial) product of two C-series results in terms
that are not in the Legendre polynomial basis set.  Thus, to express
the product as a Legendre series, it is necessary to "reproject" the
product onto said basis set, which may produce "unintuitive" (but
correct) results; see Examples section below.

Examples
--------
>>> from numpy.polynomial import legendre as L
>>> c1 = (1,2,3)
>>> c2 = (3,2)
>>> P.legmul(c1,c2) # multiplication requires "reprojection"
array([  4.33333333,  10.4       ,  11.66666667,   3.6       ])