PDA

View Full Version : Mathematica Conjugate of a Function Assuming Real Variables


rynlee
Feb16-11, 08:30 AM
Hi All,

In mathematica, I'm trying to use Conjugate[] to take the complex conjugate of a function that has imaginary numbers in it, but I want to tell mathematica that the variables are real and positive, so that it can nicely combine terms into, say, x^2 instead of x*x.

I've tried doing this using the Assuming[] function, but while it compiles fine it has no effect, the code I'm using is as follows:

Assuming[{m \[Element] Reals, \[Omega] \[Element] Reals,
a \[Element] Reals, h \[Element] Reals, \[Omega] > 0, m > 0, h > 0},
Conjugate[psi[x, t]]*psi[x, t]]

where earlier psi[x_,t_] is defined as:
psi[x_, t_] := ((m*\[Omega])/(Pi*h))^(1/4)*
Exp[((-m*\[Omega])/(2*h))*(x^2 + (a^2)*(1 + Exp[-2*I*\[Omega]*t])/
2 + I*h*t/m - 2*a*x*Exp[-I*\[Omega]*t])]

note that there are imaginary components to the function, even though the variables are real and positive.

Is there a better way to accomplish this than the Assuming[] function, or am I using Assuming[] wrong? I also tried nested Assuming[]'s, i.e. Assuming[m\[Element] Reals, Assuming[a \[Element] Reals, Assuming[.....

Thanks for any advice!

Bill Simpson
Feb16-11, 12:17 PM
Users sometimes expect magic power from Assuming. ALL it does is add some declarations to a list on the wall. Some functions in Mathematica look at that list, many do not.

Simplify looks at the list. Try wrapping a Simplify around your Conjugate. Then FullSimplify the result of that. Then use your Assuming with another Simplify inside that on the result from FullSimplify. That should get you to something like

(E^(ω*(Im[t] - (m*Re[(a^2*(1 + E^((-2*I)*t*ω)))/2 - (2*a*x)/E^(I*t*ω) + x^2])/h))*Sqrt[(m*ω)/h])/Sqrt[Pi]

If you can Assume t is real then it can make this a little simpler.

bulinator
Jul18-11, 05:34 AM
For the case the problem still exists.
Define a pattren
pattern={I->-I,-I->I}
If you want you can define a new function
ConjugateNEW[A_]:=A/.pattern