# Complex conjugate

How do I complex conjugate a vector?

E^(-((I β)/2)) p (Cos[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (-I Cos[ϕ] + Sin[ϕ]))
+ E^(I β)Sin[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (I Cos[ϕ] + Sin[ϕ])))

I tried doing Assuming[β ∈ Reals, c[[1]]^*, but that didn't work :\ ... I just want i's flipped, but I'm getting this:

Attempt at using ComplexExpand as suggested my LLiaMnYP. Still doesn't look as compact as c[[1]] if I just change all the i's by hand :(

• You are getting this as there is no way for Mathematica to know, that all other variables are real. Check out the documentation for ComplexExpand IIRC. – LLlAMnYP Mar 17 '15 at 23:30
• tried it... see pic above... naturally, Mathematica decided to expand exponentials and rearrange everything %\ and cc* product has changed to a really long string compared to what it was when I just changed i's manually – Raksha Mar 17 '15 at 23:39
• Is p a factor or a function? – Mahdi Mar 17 '15 at 23:43
• p is a factor here – Raksha Mar 17 '15 at 23:44

Is this what you wanted?

expr = E^(-((I β)/2)) p (Cos[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (-I Cos[ϕ] + Sin[ϕ])) +
E^(I β) Sin[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (I Cos[ϕ] + Sin[ϕ])))

expr /. Complex[x_, y_] :> Complex[x, -y]

• YES! Thank you! Tho it also returned "Complex::argr: Complex called with 1 argument; 2 arguments are expected." for some reason. – Raksha Mar 17 '15 at 23:56
• @Solarmew please try it now. – Nasser Mar 18 '15 at 0:00
• Perfect :] Thanks so much! – Raksha Mar 18 '15 at 0:25
• Cool trick. This does literally "flip the i's", as OP requested. Just be warned, if you have I represented as Sqrt[-1] anywhere, this will probably not work. – LLlAMnYP Mar 18 '15 at 0:44
• Agreed, I was too lazy to extend to more elaborate constructs such as Sqrt[-a] (where a may be positive, but not have a value assigned to it and remain in symbolic form) and a large class of functions, although elementary, but for which the relation Conjufate[f[x]]==f[Conjugate[x]] does not hold. Of course, OP's expression does happen to be one of those where you just need to flip the Is, I just wanted to point out, that your trick may not work in some cases even if all variables are real. – LLlAMnYP Mar 18 '15 at 1:31

You might use:

FullSimplify@ComplexExpand@Conjugate[(* expression *)]

$$e^{\frac{i \beta }{2}} p \left(\sin \left(\frac{\alpha }{2}\right) e^{-i (\beta -\phi )} \left(\cos ^2(\theta ) \cos (\phi )-i \sin (\phi )\right)+\cos \left(\frac{\alpha }{2}\right) \left(\cos ^2(\theta )+\sin ^2(\theta ) \sin (\phi ) (\sin (\phi )+i \cos (\phi ))\right)\right)$$

• Mine still returned the same expression as in the first picture, but without Conjugate[ ] around beta. (how did you input such pretty text so fast?) I also typed {beta, p, alpha, theta, phi} instead of just beta. That got p outside of Conjugate[ ] but left all the trig functions in. Tried including trig function, but that also didn't do anything. – Raksha Mar 17 '15 at 23:43
• @Solarmew such "pretty text" is input using $\LaTeX$. See a basic help page and an extended tutorial about what MathJax supports. – Ruslan Mar 18 '15 at 4:45

You can also do

Refine[Conjugate@c[[1]],
Assumptions->(\[Alpha] | \[Beta] | \[Phi]) \[Element] Reals]

This also works in cases when you have additional manifestly complex variables in your expression (ComplexExpand assumes that all variables are real). Of course in that case you would not add those in your Assumptions. For example:

Refine[Conjugate[a b], Assumptions -> a \[Element] Reals]
(*
==> a Conjugate[b]
*)