What is the easiest way to draw a function like this one?$$\frac{1}{7}e^{-2x^2}(1-4x^2)$$ I calculated the roots $x=-1/2$, $x=1/2$ and limit which is equal to $0$
I can't just substitute some values like $f(0)\approx 0,15$ into the formula and draw it, can I?
Asked
Active
Viewed 385 times
0
mashhc
- 125
- 6
-
2Take it's derivative, that often gives you a picture of how the function changes. – Rushabh Mehta Jan 03 '19 at 17:50
-
1The easiest way is to ask Wolfram Alpha, but that's probably not what you really want. – Robert Israel Jan 03 '19 at 17:57
1 Answers
3
A good approach is to see what each factor does. The second factor $1 - 4x^2$ is a parabola opening down, and at $x = 0$ reaches its maximum $1$. The first factor takes everything and makes it smaller, unless $x$ is very close to $0$, in which case it just leaves it mostly unchanged.
So in you put these ideas together: you expect a parabola close to the origin, going to zero as $x$ moves away from $0$
A minimal version of the code to produce the graph above in Python
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-2, 2, num = 200)
y1 = np.exp(-2 * x**2)
y2 = 1 - 4 * x**2
plt.plot(x, y1)
plt.plot(x, y2)
plt.plot(x, y1 * y2)
plt.show()
caverac
- 19,345
