Finite-dimensional matrix representation of the operator of differentiation through the algebra of raising and lowering operators: general properties and explicit examples