The Vedanta Sutras of Badarayana, Commentary by Sankara (SBE38), tr. by George Thibaut  at sacred-texts.com
46. (As the soul is affected by pleasure and pain) not so the highest (Lord); as in the case of light and so on.
We maintain that the highest Lord does not feel the pain of the samsâra-state in the same way as the soul does. The soul being engrossed by Nescience identifies itself as it were
with the body and so on, and imagines itself to be affected by the experience of pain which is due to Nescience, 'I am afflicted by the pain due to the body;' the highest Lord, on the other hand, neither identifies himself with a body, nor imagines himself to be afflicted by pain. The pain of the individual soul also is not real, but imaginary only, caused by the error consisting in the non-discrimination of (the Self from) the body, senses, and other limiting adjuncts which are due to name and form, the effects of Nescience. And as a person feels the pain of a burn or cut which affects his body by erroneously identifying himself with the latter, so he feels also the pain affecting others, such as sons or friends, by erroneously identifying himself with them, entering as it were into them through love, and imagining 'I am the son, I am the friend.' Wherefrom we infer with certainty that the feeling of pain is due merely to the error of false imagination. At the same conclusion we arrive on the ground of negative instances. Let us consider the case of many men, each of whom possesses sons, friends, &c., sitting together, some of them erroneously imagining that they are connected with their sons, friends, &c., while others do not. If then somebody calls out 'the son has died,' 'the friend has died,' grief is produced in the minds of those who are under the imagination of being connected with sons and friends, but not in the minds of religious mendicants who have freed themselves from that imagination. From this it appears that perfect knowledge is of use even to an ordinary man; of how much greater use then will it be to him (i.e. the Lord) whose nature is eternal pure intelligence, who sees nothing beside the Self for which there are no objects. Hence it follows that perfect knowledge is not purposeless.--To illustrate this view the Sûtra introduces a comparison 'like light,' &c. Just as the light of the sun or the moon which pervades the entire space becomes straight or bent as it were when the limiting adjuncts with which it is in contact, such as a finger, for instance, are straight or bent, but does not really become so; and just as the ether, although imagined to move as it were when jars are being moved, does not really move; and as the sun does not tremble,
although its image trembles when you shake the cup filled with water in which the sun's light is reflected; thus the Lord also is not affected by pain, although pain be felt by that part of him which is called the individual soul, is presented by Nescience, and limited by the buddhi and other adjuncts. That also the soul's undergoing pain is due to Nescience only, we have already explained. Accordingly the Vedânta--texts teach that, when the soul's individual state, due to Nescience, is sublated, it becomes Brahman, 'Thou art that &c.'--Thus there is no occasion to conclude that the highest Self is affected by the pain of the individual soul.