Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
FullSimplify[(Exp[x*I] + Conjugate[Exp[x*I]])/2, x ∈ Reals] // TraditionalForm –  J. M. Apr 29 '13 at 14:16
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

Another approach:

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

Cos[x]

share|improve this answer
add comment
(ExpToTrig@Exp[x*I])[[1]]

Cos[x]

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

Cos[x]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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