Mathematica Plots Wrong: How is it Possible?

  • Context: Mathematica 
  • Thread starter Thread starter nikolafmf
  • Start date Start date
  • Tags Tags
    Mathematica Plots
Click For Summary
SUMMARY

The discussion centers on the behavior of Mathematica when plotting the function defined by the equation Plot[Exp[-Sqrt[-x]] + Exp[Sqrt[-x]] - 2 == 0, {x, -10, 40}]. Users noted that despite the presence of the square root of -x, which suggests the function should only be defined for x ≤ 0, Mathematica generates a plot for positive values of x. This occurs because for x > 0, the expression simplifies to 2Cos[Sqrt[x]], which is valid for all real x > 0, demonstrating the application of Euler's formula.

PREREQUISITES
  • Understanding of complex numbers and their properties
  • Familiarity with Mathematica syntax and plotting functions
  • Knowledge of Euler's formula and its implications
  • Basic concepts of real and complex analysis
NEXT STEPS
  • Explore advanced Mathematica plotting techniques for complex functions
  • Study the implications of Euler's formula in various mathematical contexts
  • Learn about the behavior of functions involving square roots of negative numbers
  • Investigate the differences between real and complex function plots in Mathematica
USEFUL FOR

Mathematics students, educators, and researchers interested in complex analysis, as well as Mathematica users seeking to understand the nuances of function plotting in the software.

nikolafmf
Messages
112
Reaction score
0
I said to Mathematica to plot a graph as this:

Plot[Exp[-Sqrt[-x]] + Exp[Sqrt[-x]] - 2 == 0, {x, -10, 40}].

You can see that there is square root of -x, which should mean that the function is defined only for x<=0. But no, Mathematica would plot a curve also for positive values of x. How is this possible at all?
 
Physics news on Phys.org
Note that when x > 0, we have Exp[-Sqrt[-x]] + Exp[Sqrt[-x]] = Exp[-iSqrt[x]] + Exp[iSqrt[x]] = 2Cos[Sqrt[x]], which is defined and a real number for all real values of x > 0. The latter equality is a result of Euler's formula.
 
  • Like
Likes   Reactions: 1 person

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K