1
$\begingroup$

Bug introduced in 8 or earlier and persisting in 11.1


This is more out of curiosity than for any project that I'm working on.

I was experimenting with the ParametricPlot3D and put in the following code:

ParametricPlot3D[{x, Im[(-1)^(5 x)], Im[(-1)^(5 x)]}, {x, 0, 1}].

For some odd reason I didn't get a waveform that was tilted 45 degrees but instead a flatline. Does anyone know why this is? I contacted Wolfram Research about it weeks ago and I haven't heard from them. It doesn't do this if I use Im[E^(I*Pi*x*5)], Im[(-1)^(x*5)], then it works perfectly it is only a problem if I base it around -1.

A screenshot of the output is below. enter image description here

$\endgroup$
1
  • $\begingroup$ I'm more interested in why this occurs, I know how to get the Sin[pi*x*5] waveform titled at 45 degrees, I just don't know why it does this when I use a base of -1. $\endgroup$ Feb 4, 2017 at 3:01

2 Answers 2

2
$\begingroup$
ex = Im@ComplexExpand[(-1)^(5 x)]
ParametricPlot3D[{x, ex, ex}, {x, 0, 1}]

enter image description here

$\endgroup$
2
  • $\begingroup$ ex = Assuming[Element[x, Reals], Simplify@Im@ComplexExpand[(-1)^(5 x)]] or ex = Assuming[Element[x, Reals], FullSimplify@Im[(-1)^(5 x)]] will evaluate to Sin[5*Pi*x] $\endgroup$
    – Bob Hanlon
    Jan 30, 2018 at 17:31
  • $\begingroup$ @BobHanlon yes I appreciate that (-1)^5=exp(5Pi x) and hence the imaginary part is Sin[5 Pi x] and by inspection could have just substituted it into ParametricPlot3D. I interpreted the question as how to get MMA to interpret. I agree that your expression shows this explicitly. I accept it as a constructive comment. $\endgroup$
    – ubpdqn
    Jan 30, 2018 at 20:45
1
$\begingroup$
ParametricPlot3D[
  {x, 
   Evaluate[Im[(-1)^(5 x)]], 
   Evaluate[Im[(-1)^(5 x)]]},
 {x, 0, 1}]

or

ParametricPlot3D[
       Evaluate /@ {x, Im[(-1)^(5 x)], Im[(-1)^(5 x)]},
       {x, 0, 1}]
$\endgroup$
3
  • 2
    $\begingroup$ Or ParametricPlot3D[ Simplify@{x, Im[(-1)^(x*5)], Im[(-1)^(x*5)]}, {x, 0, 1}] or ParametricPlot3D[ ComplexExpand@{x, Im[(-1)^(x*5)], Im[(-1)^(x*5)]}, {x, 0, 1}] $\endgroup$
    – Bob Hanlon
    Feb 4, 2017 at 2:33
  • $\begingroup$ Evaluate does nothing unless it is in the first level of holding expression. $\endgroup$
    – Kuba
    Aug 3, 2017 at 13:05
  • $\begingroup$ even just this fixes it.. ParametricPlot3D[{Evaluate@x, Im[(-1)^(5 x)], Im[(-1)^(5 x)]}, {x, 0, 1}] bizarre.. $\endgroup$
    – george2079
    Jan 30, 2018 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.