def differentiate(coefficients):
    """
    Calculates the derivative of a polynomial and returns
    the corresponding coefficients.
    """

    new_cos = []
    #ignore the first coefficient as it will always become 0
    #when taking derivative of a polynomial
    for deg, prev_co in enumerate(coefficients[1:]):
        #use (deg+1) because we have ignore first coefficient but
        #array indexing still starts from 0
        #so a^2 will become 2a
        new_cos.append((deg+1) * prev_co)

    #return update coefficients
    return new_cos