Hi Arina.

I understand your frustration. The capabilities of `cadabra`

are a bless and a curse.

I believe that the "problem" is that `cadabra`

was born as a tool for manipulation, not calculation (perhaps Kasper could tell us the story one day).

In defense of `cadabra`

, even great calculation software, e.g. `Mathematica`

, `Maple`

or `sagemath`

, suffer of the same problem.

A typical example in `Mathematica`

is the simple calculation of `Sqrt[x^2]`

. Even if you later simplify the expression, you won't get the expexted result, because the software is not assuming that the variable is real (which is an advantage in certain situations, but probably not most of the time).

The main purpuse of mathematical software is to help you obtain the result, less prone to errors. It is a good praxis to check manually if the expressions might simplify farther.

Now, in order to reduce the amount of time spent in manual manipulation of the expression, try to use different algorithms before (gladly, usually those take just a few moments to the computer).

In your example, consider the following:

```
ex := 6 A B + 6 A C;
factor_out(ex, $A$);
```

The above yield an unexpected result. But,

```
ex := 6 A B + 6 A C;
simplify(ex);
```

returns what you expect.

Of course this is a very simple case. Moving a bit a further, consider

```
ex := 6 A B + 6 A C + 6 B C;
factor_out(ex, $A$);
simplify(ex);
```

You'd noticed that the factorisation does not fulfil our expectations, but the additional simplification does!

If your expressions allows it, try using different `sympy`

algebraic algorithms (or `Mathematica`

's).

Sorry for the extended (and possibly unsatisfactory) contribution.

Cheers,
Dox.

# Update 1

In order to pass more than one arguments to the `map_sympy`

algorithm, just include additional strings, for example

```
ex := 6 A B + 6 A C;
map_sympy(ex, "collect", "A");
```