Detail solution
For every modulo expressions in the equation
allow cases, when this expressions ">=0" or "<0",
solve the resulting equation.
1.
$$x + 2 \geq 0$$
$$x - 2 \geq 0$$
or
$$2 \leq x \wedge x < \infty$$
we get the equation
$$a \left(x + 2\right) - \left(1 - a\right) \left(x - 2\right) + 3 = 0$$
after simplifying we get
$$a \left(x + 2\right) - \left(1 - a\right) \left(x - 2\right) + 3 = 0$$
the solution in this interval:
$$x_{1} = - \frac{5}{2 a - 1}$$
2.
$$x + 2 \geq 0$$
$$x - 2 < 0$$
or
$$-2 \leq x \wedge x < 2$$
we get the equation
$$a \left(x + 2\right) - \left(1 - a\right) \left(2 - x\right) + 3 = 0$$
after simplifying we get
$$a \left(x + 2\right) - \left(1 - a\right) \left(2 - x\right) + 3 = 0$$
the solution in this interval:
$$x_{2} = - 4 a - 1$$
3.
$$x + 2 < 0$$
$$x - 2 \geq 0$$
The inequality system has no solutions, see the next condition
4.
$$x + 2 < 0$$
$$x - 2 < 0$$
or
$$-\infty < x \wedge x < -2$$
we get the equation
$$a \left(- x - 2\right) - \left(1 - a\right) \left(2 - x\right) + 3 = 0$$
after simplifying we get
$$a \left(- x - 2\right) - \left(1 - a\right) \left(2 - x\right) + 3 = 0$$
the solution in this interval:
$$x_{3} = \frac{1}{2 a - 1}$$
The final answer:
$$x_{1} = - \frac{5}{2 a - 1}$$
$$x_{2} = - 4 a - 1$$
$$x_{3} = \frac{1}{2 a - 1}$$
Sum and product of roots
[src]
// -5 5 \ // -5 5 \ // 1 \ // 1 \
//-1 - 4*a for And(a <= 1/4, a > -3/4)\ //-1 - 4*a for And(a <= 1/4, a > -3/4)\ ||-------- for -------- <= -2| ||-------- for -------- <= -2| ||-------- for And(a > 1/4, a < 1/2)| ||-------- for And(a > 1/4, a < 1/2)|
I*im|< | + re|< | + I*im|<-1 + 2*a -1 + 2*a | + re|<-1 + 2*a -1 + 2*a | + I*im|<-1 + 2*a | + re|<-1 + 2*a |
\\ nan otherwise / \\ nan otherwise / || | || | || | || |
\\ nan otherwise / \\ nan otherwise / \\ nan otherwise / \\ nan otherwise /
$$\left(\left(\operatorname{re}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right) + \left(\operatorname{re}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right)\right) + \left(\operatorname{re}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right)$$
// 1 \ // -5 5 \ // 1 \ // -5 5 \
||-------- for And(a > 1/4, a < 1/2)| ||-------- for -------- <= -2| //-1 - 4*a for And(a <= 1/4, a > -3/4)\ ||-------- for And(a > 1/4, a < 1/2)| ||-------- for -------- <= -2| //-1 - 4*a for And(a <= 1/4, a > -3/4)\
I*im|<-1 + 2*a | + I*im|<-1 + 2*a -1 + 2*a | + I*im|< | + re|<-1 + 2*a | + re|<-1 + 2*a -1 + 2*a | + re|< |
|| | || | \\ nan otherwise / || | || | \\ nan otherwise /
\\ nan otherwise / \\ nan otherwise / \\ nan otherwise / \\ nan otherwise /
$$\operatorname{re}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + \operatorname{re}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)} + \operatorname{re}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)}$$
/ // -5 5 \ // -5 5 \\ / // 1 \ // 1 \\
/ //-1 - 4*a for And(a <= 1/4, a > -3/4)\ //-1 - 4*a for And(a <= 1/4, a > -3/4)\\ | ||-------- for -------- <= -2| ||-------- for -------- <= -2|| | ||-------- for And(a > 1/4, a < 1/2)| ||-------- for And(a > 1/4, a < 1/2)||
|I*im|< | + re|< ||*|I*im|<-1 + 2*a -1 + 2*a | + re|<-1 + 2*a -1 + 2*a ||*|I*im|<-1 + 2*a | + re|<-1 + 2*a ||
\ \\ nan otherwise / \\ nan otherwise // | || | || || | || | || ||
\ \\ nan otherwise / \\ nan otherwise // \ \\ nan otherwise / \\ nan otherwise //
$$\left(\operatorname{re}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right) \left(\operatorname{re}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right) \left(\operatorname{re}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)}\right)$$
$$\text{NaN}$$
//-1 - 4*a for And(a <= 1/4, a > -3/4)\ //-1 - 4*a for And(a <= 1/4, a > -3/4)\
x1 = I*im|< | + re|< |
\\ nan otherwise / \\ nan otherwise /
$$x_{1} = \operatorname{re}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - 4 a - 1 & \text{for}\: a \leq \frac{1}{4} \wedge a > - \frac{3}{4} \\\text{NaN} & \text{otherwise} \end{cases}\right)}$$
// -5 5 \ // -5 5 \
||-------- for -------- <= -2| ||-------- for -------- <= -2|
x2 = I*im|<-1 + 2*a -1 + 2*a | + re|<-1 + 2*a -1 + 2*a |
|| | || |
\\ nan otherwise / \\ nan otherwise /
$$x_{2} = \operatorname{re}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} - \frac{5}{2 a - 1} & \text{for}\: \frac{5}{2 a - 1} \leq -2 \\\text{NaN} & \text{otherwise} \end{cases}\right)}$$
// 1 \ // 1 \
||-------- for And(a > 1/4, a < 1/2)| ||-------- for And(a > 1/4, a < 1/2)|
x3 = I*im|<-1 + 2*a | + re|<-1 + 2*a |
|| | || |
\\ nan otherwise / \\ nan otherwise /
$$x_{3} = \operatorname{re}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)} + i \operatorname{im}{\left(\begin{cases} \frac{1}{2 a - 1} & \text{for}\: a > \frac{1}{4} \wedge a < \frac{1}{2} \\\text{NaN} & \text{otherwise} \end{cases}\right)}$$
x3 = re(Piecewise((1/(2*a - 1, (a > 1/4) & (a < 1/2)), (nan, True))) + i*im(Piecewise((1/(2*a - 1), (a > 1/4) & (a < 1/2)), (nan, True))))