Why is Mathematica giving an error when trying to plot xe^{-x}?

  • Thread starter Thread starter flyingpig
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The error encountered when attempting to plot xe^{-x} in Mathematica is due to the incorrect use of the exponential function. Users are advised to replace e^(-x) with Exp[-x] to avoid the Plot::exclul error message. The suggested command is Plot[x*Exp[-x], {x, 0, 5}]. Additionally, specifying the PlotRange does not resolve the issue if the exponential function is not correctly defined. Using the correct syntax will enable successful plotting of the function.
flyingpig
Messages
2,574
Reaction score
1

Homework Statement



I am trying to plot xe^{-x} by using Plot[x*e^(-x), {x, 0, 5}] and it keeps telling me that

Plot::exclul: must be a list of equalities or real-valued functions.

So I tried

Plot[x*e^(-x), {x, 0, 5}, PlotRange -> {-10, 10}]

Still not working



The Attempt at a Solution

 
Physics news on Phys.org
Try using 'Exp[-x]' for the exponential rather than 'e^(-x)'.
 
Back
Top