2.2

import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import quad

def fun(t, x):
return np.exp(-t) * (t ** (x - 1))

x = np.linspace(0, 10, 100)
y = [quad(fun, 0, np.inf, args=i)[0] for i in x]

plt.plot(x, y)
plt.xlabel('x')
plt.ylabel('$ y = \int_0^{\infty} e^{-t} \cdot t^{x-1} dt $')
plt.grid(True)
plt.show()


3022

posted @ 2024-10-21 21:02  Tsuki*  阅读(10)  评论(0)    收藏  举报