I think the verbal expression of your question doesn't reflect that equation you put in your comment. That is perfectly right according to the your equation but not for the verbal representation:
Let In be the identity matrix of order n, and Dn=diag(d1,d2,d3,.........,dn) be the diagonal matix such that all di's are non-zeros. Then (In+Dn)-1=In+ (Dn)-1=
In+diag(1/d1,1/d2,1/d3,.........,1/dn)=diag(1+1/d1,1+1/d2,1+1/d3,.........,1+1/dn). Similarly, we get the same result for (Dn+In)-1.
What I Feel he is asking to find the inverse of the matrix ( X + Y), Let X = I be the identity matrix of order n, and Y = diag(d₁,d₂,⋯,d_{n}) be a diagonal matrix of order n.
Thus X + Y = diag(1+d₁, !+d₂,⋯,1+d_{n}) and so
inverse of the matrix ( X + Y) = diag(1/(1+d₁),1/(1+d₂),⋯,1/(1+d_{n})).
First of all we have to check whether X+Y is non singular or not, If so, then sum is also a diagonal matrix and hence its inverse is the reciprocals of its diagonal elements.