极限是微积分的基石,描述函数在某点附近的趋势:
limx→af(x)=L
经典极限:
limx→0xsinx=1
limn→∞(1+n1)n=e
导数描述函数的瞬时变化率,定义为:
f′(x)=limh→0hf(x+h)−f(x)
常用求导公式
| 函数 | 导数 |
|---|
| xn | nxn−1 |
| ex | ex |
| lnx | x1 |
| sinx | cosx |
| cosx | −sinx |
链式法则
dxd[f(g(x))]=f′(g(x))⋅g′(x)
积分是导数的逆运算,也表示曲线下的面积:
∫abf(x)dx=F(b)−F(a)
其中 F′(x)=f(x)(微积分基本定理)。
常用积分公式
∫xndx=n+1xn+1+C(n=−1)
∫exdx=ex+C
∫x1dx=ln∣x∣+C
∫sinxdx=−cosx+C
分部积分
∫udv=uv−∫vdu
Manim 示例:绘制导数切线
from manim import *
class DerivativeVisualization(Scene):
def construct(self):
axes = Axes(x_range=[-3, 3], y_range=[-1, 9])
curve = axes.plot(lambda x: x**2, color=BLUE)
label = axes.get_graph_label(curve, label="f(x)=x^2")
tangent = axes.plot(lambda x: 2*x - 1, color=YELLOW)
self.play(Create(axes), Create(curve), Write(label))
self.play(Create(tangent))
self.wait(2)