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