1
$\begingroup$

I want to get a cosine from taking the real part of a complex exponential: $cos(x) = Re(exp(i x))$. What I do in Mathematica is

(1/2)*(Exp[x*I] + Conjugate[Exp[x*I]]) // TraditionalForm // FullSimplify

but this gives me 1/2 (E^(-I x^\[Conjugate]) + E^(I x)) instead of cos(x). Why is that?

$\endgroup$
1
  • $\begingroup$ FullSimplify[(Exp[x*I] + Conjugate[Exp[x*I]])/2, x ∈ Reals] // TraditionalForm $\endgroup$ Apr 29, 2013 at 14:16

3 Answers 3

4
$\begingroup$

Try!

(1/2)*(Exp[x*I] + Conjugate[Exp[x*I]])// ComplexExpand

Cos[x]

Also note that TraditionalForm is a formatting tool mainly for displaying the formulas in a nice manner. After you have applied TraditionalForm on an expression other Mathematica built in functions (e.g FullSimplify) may have problem to deal with the expression as an input. Hence better to use TraditionalForm only for displaying expressions.

$\endgroup$
0
3
$\begingroup$

Another approach:

Simplify[ExpToTrig @ Re[E^(I x)], x ∈ Reals]

Cos[x]

$\endgroup$
0
$\begingroup$
(ExpToTrig@Exp[x*I])[[1]]

Cos[x]

ComplexExpand[Exp[x*I]] /. I -> 0

Cos[x]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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