Mathematica Conjugate of a Function Assuming Real Variables

Click For Summary

Discussion Overview

The discussion revolves around the use of the Conjugate function in Mathematica, specifically in the context of taking the complex conjugate of a function with imaginary components while assuming that certain variables are real and positive. Participants explore methods to effectively utilize the Assuming function and related commands to achieve the desired simplification.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant expresses difficulty in using the Assuming function to simplify the complex conjugate of a function, questioning whether they are using it correctly.
  • Another participant clarifies that the Assuming function merely adds declarations and that not all functions in Mathematica consider these declarations, suggesting the use of Simplify and FullSimplify to achieve the desired result.
  • A different approach is proposed involving defining a pattern to manually handle the conjugation of imaginary components.
  • One participant emphasizes the importance of the order of commands, noting that the Assuming function must encompass the entire expression for it to be effective.
  • Another participant suggests using Refine with the Assumptions option as an alternative method to achieve simplification.

Areas of Agreement / Disagreement

Participants generally agree on the limitations of the Assuming function and the need for careful structuring of commands. However, multiple approaches are proposed, indicating that there is no single consensus on the best method to achieve the desired simplification.

Contextual Notes

Participants note that the effectiveness of the Assuming function can vary depending on the specific functions used and the order of operations, highlighting potential limitations in the assumptions being applied.

rynlee
Messages
44
Reaction score
0
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:

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

where earlier psi[x_,t_] is defined as:
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])]

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!
 
Physics news on Phys.org
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.
 
For the case the problem still exists.
Define a pattren
Code:
pattern={I->-I,-I->I}
If you want you can define a new function
Code:
ConjugateNEW[A_]:=A/.pattern
 
  • Like
Likes   Reactions: hunc
Order is Important

I have been stuck with related problems several times, the example below shows when assume will and won't be effective:


Simplify[Assuming[p \[Element] Reals, Conjugate[p]]]

returns:
Conjugate[p]

Assuming[p \[Element] Reals, Simplify[Conjugate[p]]]

returns:
p


The assuming command must be around everything, including the simplify command, for the assumptions to be used effectively.
 
You can also put it as a requirement of a function :

Refine[Conjugate[p], Assumptions -> p \[Element] Reals]

Simplify[Conjugate[p], Assumptions -> p \[Element] Reals]
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K