Hmmm...

    >>> t1 = diff((X*w)[i,0], w[j,0])
    >>> t2 = diff((X*w)[i,0], w[j,0])
    >>> (t1, t2, t1 == t2)
    (Derivative(Sum(X[i, _k]*w[_k, 0], (_k, 0, n - 1)), w[j, 0]),
     Derivative(Sum(X[i, _k]*w[_k, 0], (_k, 0, n - 1)), w[j, 0]),
     False)

Also I don't want to compare the solution with a hard coded result because this would create an unnecessary dependency on implementation details of the matrix operators. I just want to make sure that it did not evaluate the Derivative. I could also use `... != 0` but I thought that `isinstance(..., Derivative)` is more specific.