# Taking real and imaginary parts after reciprocal

I noticed the following strange scenario. When I defined a variable to be real, Mathematica does not only recognize that it is real after taking an inverse. How can I resolve this so that it will recognize 1/x is still real?

In:= $Assumptions = {x ∈ Reals} Out= {x ∈ Reals} In:= Im[x] Out= Im[x] In:= Refine[Im[x]] Out= 0 In:= Refine[Re[x]] Out= x In:= Refine[Im[1/x]] Out= Im[1/x] In:= Refine[Re[1/x]] Out= Re[1/x]  • Another way to do it is use ComplexExpand without any assumptions. For example: $Assumptions = True; ReIm[ 1 / x ] // ComplexExpand – LouisB Jun 6 '19 at 22:29
• You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful – Michael E2 Jun 6 '19 at 23:36

If x=0, then 1/0 is ComplexInfinity. If you add the assumption that x!=0, then you get what you are wanting:
 Assuming[{b \[Element] Reals, b != 0}, Refine[Im[1/b]]]

   0