Wrong result in Wolfram Alpha on graph

323 Views Asked by At

I'm learning to code in Python, so I tried to find roots and draw a graph of a function $-(16x^2-24x+5)e^{-x}$ 1

Result i got in Python using the mat.plotlib library is this enter image description here

The problem is that Wolfram alpha is giving me the same graph, but it's incorrect. If you use x=1 in 1, y =1.104, not 0 as Wolfram alpha or Python are showing. I'm confused why Wolfram and even Python are plotting wrong graphs?

2

There are 2 best solutions below

1
On

At the scale of your graph you can't tell $y=0$ from $y=1.104$. The scale comes from starting the plot around $x=-5$ where the function value is almost $-80000.$ If we plot it in Alpha with a range of $0$ to $2$ we can see that at $x=1$ the value is around $1$ enter image description here

1
On

You are correct and the graphs are correct too. What you see as zero is not really zero.

Your confusion is about the scale of the curves.

If you check the scale you see that it changes from $-10000$ to zero in a tiny space so the distnace between zero and $1.104$ is so small that you see it as zero.

If you cahnge your widow to $[-2,2]\times [-2,2]$ then you see the difference.