I want to find $a,b \in \mathbb{C}$ such that $$|1-2a-2b| < 1 \quad \text{&} \quad |1-2a+2b| < 1$$ using mathematica. I tried to use Solve[{Abs[1 - 2 a - 2 b] < 1, Abs[1 - 2 a + 2 b] < 1}, {a, b}]
but it never finishes the evaluation. How do I proceed?
5 Answers
Clear["Global`*"]
ineq = {Abs[1 - 2 a - 2 b] < 1, Abs[1 - 2 a + 2 b] < 1};
As recommended by Daniel Huber, define intermediate variables
eq = {c == a + b, d == a - b};
The inequalities are equivalent to
sol = Reduce[Join[ineq, eq], {c, d}, {a, b}] /. (eq /. Equal -> Rule)
(* 0 < Re[a + b] < 1 && -Sqrt[Re[a + b] - Re[a + b]^2] < Im[a + b] < Sqrt[
Re[a + b] - Re[a + b]^2] &&
0 < Re[a - b] < 1 && -Sqrt[Re[a - b] - Re[a - b]^2] < Im[a - b] < Sqrt[
Re[a - b] - Re[a - b]^2] *)
As recommended by rmw, use FindInstance
to get specific examples,
(ex = FindInstance[sol, {a, b}, Complexes, 5]) // Column
Verifying that ex
satisfy ineq
And @@ (And @@ ineq /. ex)
(* True *)
-
$\begingroup$ Why should Mathematica not be able to handle the original equations. It is understood that making the substitutions simplifies things somewhat, but Mathematica cannot see that? $\endgroup$– mjwJan 7, 2021 at 22:03
-
1$\begingroup$ @mjw - Whether Mathematica "should" be able to solve any given problem is subjective. However, you can anticipate that you will encounter problems that it cannot directly solve. Many indirect approaches or workarounds are available. $\endgroup$ Jan 8, 2021 at 0:08
You may simplify the equations by setting:
c= a+b
d= a-b
Then we get the following equations:
eq={Abs[1 - 2 c] < 1, Abs[1 - 2 d] < 1}
that can be solved by Reduce
Reduce[eq, {c, d}]
-
2$\begingroup$ Even better:
Abs[1-2c]<1
is the circle in the complex plane centered at 1 with radius 1/2, and similarly forAbs[1-2d]<1
. $\endgroup$ Jan 8, 2021 at 8:39
Reduce[{Abs[1 - 2 a - 2 b] < 1,
Abs[1 - 2 a + 2 b] < 1} /. {a -> x + I*y, b -> u + I*v} //
ComplexExpand, {x, y, u, v}, Reals]
The result is too long.
For comparison, here is a human calculation. Let $z_1=2a+2b$ and $z_2=2a-2b.$ NOT CODE Then $|z_k-1|<1$ for $k=1,2.$ Thus, $$z_k=1+r_k(\cos \theta_k +i \sin \theta_k)$$ for $0\le r_k <1$ and $0 \le \theta < 2\pi.$ Consequently, $a= \frac{1}{4} (z_1+z_2)$ and $b= \frac{1}{4} (z_1-z_2).$
A picture says more than thousand words ...
Manipulate[
RegionPlot[
Evaluate@ComplexExpand[{Abs[1 - 2 a - 2 b] < 1,
Abs[1 - 2 a + 2 b] < 1} /. {a -> a1 + I*a2,
b -> b1 + I*b2}], {b1, -5, 5}, {b2, -5, 5},
Epilog -> {Red, PointSize[Large], Point[{a1, a2}]},
GridLines -> Automatic], {a1, -4, 4,
Appearance -> "Labeled"}, {a2, -4, 4, Appearance -> "Labeled"}
]
The intersection of both circles is the solution.
FindInstance[Abs[1 - 2 a - 2 b] < 1 && Abs[1 - 2 a + 2 b] < 1, {a, b}]
one get `{{a -> 45/128 - (15 I)/32, b -> 0}}´. $\endgroup$