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
.
ComplexityFunction
option of simplify is the way to go, but constructing the relevant function may not be straightforward $\endgroup$Simplify
in this case. You would rather useExcludedForms
more thanComplexityFunction
. $\endgroup$