Let's see what happens with your attempt:
Solve[Im[1 - 2 Sqrt[1 + I r] + I r] == 0, r, Reals]
Solve::nddc: The system -2 Im[Sqrt[1+I r]]+Re[r]==0 contains a nonreal constant I. With the domain \[DoubleStruckCapitalR] specified, all constants should be real.
Solve[-2 Im[Sqrt[1 + I r]] + Re[r] == 0, r, Reals]
Notice the error message. You can't use the domain Reals
when the equation to be solved contains I
. Instead, include the domain restriction along with your equation:
Solve[Im[1 - 2 Sqrt[1 + I r] + I r] == 0 && r ∈ Reals, r]
{{r -> 0}}
By the way, probably the most reliable method is the one suggested by @JM in the comments:
Solve[
ComplexExpand[Im[1-2 Sqrt[1+I r]+I r], TargetFunctions->{Re, Im}] == 0,
r,
Reals
]
{{r -> 0}, {r -> 0}, {r -> 0}}
Addendum
In the comments, the OP explained that he wanted to know the values of r
for which the imaginary part is negligible. Reduce
is a better tool in this case. For example, the values of r
for which the imaginary part is smaller in magnitude than 10^-6 can be obtained with:
Reduce[Abs @ Im[1-2 Sqrt[1+I r]+I r] < 10^-6 && r ∈ Reals, r] //N
-0.0200012 < r < 0.0200012
Solve[ComplexExpand[Im[1 - 2 Sqrt[1 + I r] + I r], TargetFunctions -> {Re, Im}] == 0, r, Reals]
$\endgroup$