2

I'm wondering if there is a different command than FullSimplify to tell mathematica to do the computation requested. Here's three variations of a simplification attempt

FullSimplify[Re[                       (-I + k Rr)] Cos[Ttheta], Element[{k, Rr, Ttheta, t, omega}, Reals]]
FullSimplify[Re[E^(I (omega t - k Rr))            ] Cos[Ttheta], Element[{k, Rr, Ttheta, t, omega}, Reals]]
FullSimplify[Re[E^(I (omega t - k Rr)) (-I + k Rr)] Cos[Ttheta], Element[{k, Rr, Ttheta, t, omega}, Reals]]

I get respectively:

k Rr Cos[Ttheta]
Cos[k Rr - omega t] Cos[Ttheta]

                I (-k Rr + omega t)
Cos[Ttheta] Re[E                    (-I + k Rr)]

Without the exponential, the real parts get evaluated. Without the complex factor multiplying the exponential, the real parts get evaluated. With both multiplied, the input is returned as output?

I tried the // Timings modifier, and this isn't because the expression is too complex (which is good since I can do this one in my head, but this was a subset of a larger test expression that was also failing).

Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
  • Looks like this would be better answered on http://math.stackexchange.com/ – Zabba Mar 12 '11 at 04:19
  • 1
    @Zabba and @Closers It is a valid Mathematica question. Please check http://meta.stackoverflow.com/questions/81152/retag-mathematica-to-wr-mathematica-or-something-similar as you are not the only one confused – Dr. belisarius Mar 12 '11 at 05:46
  • @belisarius, my premise was that people over at the math site *probably* use mathematica more than us "software types". But thanks for the link, it did clear up *why* mathematica is confusing here on SO. – Zabba Mar 12 '11 at 05:57
  • @Zabba, definitely an interesting question, however 9 tenths of the questions asked here are programming questions, and the (currently 18) questions found on http://math.stackechange.com/questions/tagged/mathematica are much more mathematics oriented than the ones found here. – rcollyer Mar 12 '11 at 16:30

3 Answers3

5

Since your variables are declared Reals have you tried ComplexExpand?

To redeem my slow posting here is another approach: tell Mathematica that you do not want Complex in the result via ComplexityFunction

FullSimplify[Re[E^(I (omega t - k Rr)) (-I + k Rr)] Cos[Ttheta], 
 Element[{k, Rr, Ttheta, t, omega}, Reals], 
 ComplexityFunction -> (1 - Boole@FreeQ[#, Complex] &)]
Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
  • +1 This is a convoluted but very interesting use of ComplexityFunction – Dr. belisarius Mar 12 '11 at 05:48
  • @belisarius I suppose that anyone regularly wanting to get very specific results from Simplify should build a library of these. I tend to be happy with one or two simple ones like `StringLength[...` but one can do much more with `ComplexityFunction` and `TransformationFunctions`. – Mr.Wizard Mar 12 '11 at 06:14
  • (+1) Maybe you should post your favourite `ComplexityFunction`s at [this SO question](http://stackoverflow.com/q/4198961/421225). – Simon Mar 13 '11 at 12:59
4

ComplexExpand, perhaps?

ComplexExpand[Re[E^(I (omega t - k Rr)) (-I + k Rr)] Cos[Ttheta]]
Mark McClure
  • 4,862
  • 21
  • 34
0

This Is a problem I've been having with Mathematica for a long time, combining suggestions from here I've created a new function that can be used instead of Simplify[] when dealing with complex arguments. Works for me so far, any further suggestions?

CSimplify[in_] := FullSimplify[in // ComplexExpand, ComplexityFunction -> (1 - Boole@FreeQ[#, Complex] &)]