Differentiate Scalar and Vector.