Explicit formulae for derivatives and primitives of orthogonal polynomials