To solve the given equations, we will simplify each equation step by step and solve for the variable \( x \) or \( a \) as required. For each equation, we will isolate the variable on one side to find its value.
Step 1: Solve the First Equation
We start with the equation:
\[
-(-4x - 2) + 2(+3) = 40
\]
Simplifying this, we have:
\[
4x + 8 = 40
\]
Subtracting 8 from both sides gives:
\[
4x = 32
\]
Dividing by 4 results in:
\[
x = 8
\]
Step 2: Solve the Second Equation
Next, we consider the equation:
\[
-(44 + -87 + (2x + 6)) = -40
\]
This simplifies to:
\[
-(37 - 2x) = -40
\]
Removing the negative sign leads to:
\[
37 - 2x = 40
\]
Subtracting 37 from both sides gives:
\[
-2x = 3
\]
Dividing by -2 results in:
\[
x = \frac{77}{2}
\]
Step 3: Solve the Third Equation
Now we solve the equation:
\[
-4 + 8 + 2x + 6 = -40
\]
This simplifies to:
\[
2x + 10 = -40
\]
Subtracting 10 from both sides gives:
\[
2x = -50
\]
Dividing by 2 results in:
\[
x = -25
\]
Step 4: Solve the Fourth Equation
Finally, we solve the equation:
\[
a + 2 = 8
\]
Subtracting 2 from both sides gives:
\[
a = 6
\]
Final Answer
The solutions to the equations are:
\[
\boxed{x = 8}
\]
\[
\boxed{x = \frac{77}{2}}
\]
\[
\boxed{x = -25}
\]
\[
\boxed{a = 6}
\]