def init_legendre_poly(result, x, pos, cur_var):
    """Initialize the first and second order before starting the recursion.

    Mathematically this amounts to
    P_1 = x
    P_2 = 3/2 * P_1*P_1 - 1/2 .

    .. note::

        The procedure on how an init function is built can be found in the
        docstring of the init function for
        standard polynomials *init_standard_poly*.


    :param result: Contains the observations along the first dimension
        and the function values of expansion w.r.t. an observation
        along the second dimension.
    :type result: numpy.ndarray

    :param x: The data to be expanded.
    :type x: numpy.ndarray

    :param pos: The index of the element to be computed, along the second
        dimension of result.
    :type int: int

    :param cur_var: The index of the current variable to be considered in the
        recursion. This value will have to be lower than x.shape[1].
    :type cur_var: int

    :returns: The index of the next element that will be computed in the
        recursion, the order of the next element, and the index of a special
        element. Is this case the first order Legendre polynomial of the 
        current variable is the special element.
    :rtype: Tuple[int, int, int]
    """
    result[:, (pos)] = x[:, (cur_var)]
    result[:, (pos + 1)] = 3.0 / 2.0 * result[:, (pos)] * result[:, (pos)
        ] - 0.5
    return pos + 2, 3, pos
