物理 [微积分的那些事]-第三回目:积分学-第十一章:不定积分的概念与基本公式
孩子们我的Overleaf终于注册好了






依旧
import numpy as np
import matplotlib.pyplot as plt
# 设置中文字体
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
# 定义x范围
x = np.linspace(-3, 3, 200)
# 不同常数C对应的积分曲线
C_list = [-4, -2, 0, 2, 4]
plt.figure(figsize=(8, 5))
for C in C_list:
y = x**2 + C
plt.plot(x, y, label=f'$y=x^2+{C}$')
# 绘制平行切线示例(x=1处)
x0 = 1
slope = 2 * x0
x_tan = np.linspace(0, 2, 10)
for C in C_list:
y_tan = slope * (x_tan - x0) + (x0**2 + C)
plt.plot(x_tan, y_tan, 'k--', alpha=0.4)
plt.title('不定积分的几何意义:积分曲线族')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid(alpha=0.3)
plt.axhline(y=0, color='k', lw=0.8)
plt.axvline(x=0, color='k', lw=0.8)
plt.tight_layout()
plt.savefig('integral_curves.png', dpi=300)
plt.show()
共0条回复
时间正序
回复是交流的起点,交流让学竞赛不孤单