I have an expression


I want to simplify this expression by defining

$f(k) \equiv 1-6e^{ik}+e^{2ik}$

So that my output will be



  • 1
    $\begingroup$ Try (Full)Simplify with the option TransformationFunctions -> {# /. (1 - 6 E^(i k) + 2^(2 i k) -> f[k]) &, Automatic} $\endgroup$ – Coolwater Mar 30 '19 at 18:41

Try this code which will do what you want.

Sqrt[1 - 6 Exp[I k] + Exp[2 I k]] /. {1 - 6 Exp[I k] + Exp[2 I k] -> f[k]}

There are other ways to do this in Mathematica, but I think this is the simplest.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.