We investigate the effects of spin-orbit coupling on the optical response of materials. In particular, we study the effects of the commutator between the spin-orbit coupling part of the potential and the position operator on the optical matrix elements. Using a formalism that separates a fullyrelativistic Kleinman-Bylander pseudopotential into the scalar-relativistic and spin-orbit-coupling parts, we calculate the contribution of the commutator arising from spin-orbit coupling to the squared optical matrix elements of isolated atoms, monolayer transition metal dichalcogenides, and topological insulators. In the case of isolated atoms from H ($Z = 1$) to Bi ($Z = 83$), the contribution of spin-orbit coupling to the squared matrix elements can be as large as 14 %. On the other hand, in the cases of monolayer transition metal dichalcogenides and topological insulators, we find that this contribution is less than 1 % and that it is sufficient to calculate the optical matrix elements and subsequent physical quantities without considering the commutator arising from spin-orbit coupling.