Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
487 B
0
Indexable
Never
import numpy as np
import matplotlib.pyplot as plt

# Definiera andra derivatan
def f_double_prime(x):
    return -2

# Skapa x-värden för att rita grafen
x = np.linspace(-5, 5, 400)

# Rita grafen
plt.figure(figsize=(10, 6))
plt.plot(x, f_double_prime(x), label="f''(x) = -2", color='green')
plt.axhline(0, color='black',linewidth=0.5)
plt.axvline(0, color='black',linewidth=0.5)

plt.xlabel('x')
plt.ylabel('y')
plt.title('Graf för f\'\'(x)')
plt.legend()
plt.grid(True)
plt.show()
Leave a Comment