- #1

- 45

- 0

## Main Question or Discussion Point

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:

where earlier psi[x_,t_] is defined as:

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!

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:

Code:

```
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]]
```

Code:

```
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])]
```

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!