#### QUESTION

A problem I am occasionally facing is to simplify an equation not to it's shortest form but to a form that is simple by other means. Often, this is grouping the term according to certain functions, for example exponential functions from a Fourier series.

For example,

```
1 Exp[i k t] + 2 x Exp[i k t] + (2 x + 1) Exp[i k t]^2 // Simplify
```

will give `E^(i k t) (1 + E^(i k t)) (1 + 2 x)`

. Instead,

```
(2 x + 1) Exp[i k t] + (2 x + 1) Exp[i 2 k t]
```

is often desired.

Is there any simple^{[1]} way to achieve that?

[1] I once achieved that using the `FourierTransform`

and replacing the `DiracDelta`

with 1 or 0 to get the coefficients, but that is neither elegant nor always possible.

#### ANSWER

There is no need to play around with `Simplify`

, since to achive what you need one can use `Collect`

, e.g.

```
expr = Exp[i k t] + 2 x Exp[i k t] + (2 x + 1) Exp[i k t]^2;
Collect[expr, Exp[i k t]]
```

`E^(i k t) (1 + 2 x) + E^(2 i k t) (1 + 2 x)`

If there are more variables you can use a list of them as the second argument, look also at `Simplify`

as the third argument in `Collect`

. As J.M. pointed out one could use also `PolynomialForm`

, to transform the expression into a more expected form, e.g.

```
Collect[expr, {Exp[i k t], x}] // PolynomialForm[#, TraditionalOrder -> True] &
```

`E^(i k t)(2 x + 1) + E^(2 i k t)(2 x + 1)`

Although it seems that `Collect`

is more appropriate for your task than `Simplify`

, you can still take advantage of the latter if you make use of options like `ExcludedForms`

to get what you would like, e.g.

```
Simplify[expr, ExcludedForms -> Exp[_]]
```

`(E^(i k t) + E^(2 i k t)) (1 + 2 x)`

or if you prefer an expanded form

```
Expand[%, E^(i k t)]
```

`E^(i k t) (1 + 2 x) + E^(2 i k t) (1 + 2 x)`

For the sake of completeness there is also `Apart`

available (it seems the simplest way) :

```
Apart[expr]
```

`E^(i k t) (1 + 2 x) + E^(2 i k t) (1 + 2 x)`

in more general cases, there is also the second argument, e.g. `Apart[expr, Exp[i k t]]`

returns the result as above.

To sum up there is no way to decide what is the best method, since all of them have their advantages, but as said before I suggest to use `Collect`

.