在物理學或工程學中,經常需要使用一種稱為微積分運算的微分。與教科書數學不同,微分函式是由實驗或計算機程式碼生成的數 據。
從公式1所示的泰勒級數開始。
f ( x + h ) = f ( x ) + f ′ ( x ) h + f ( 2 ) ( x ) 2 ! h 2 + f ( 3 ) ( x ) 3 ! h 3 + ⋯ ( 1 ) {\displaystyle f(x+h)=f(x)+f^{'}(x)h+{\frac {f^{(2)}(x)}{2!}}h^{2}+{\frac {f^{(3)}(x)}{3!}}h^{3}+\cdots \quad (1)}
接下來,在第四項之後截斷泰勒級數並在h和-h處求值,得到公式(2)和(3)。
f ( x + h ) = f ( x ) + f ′ ( x ) h + f ( 2 ) ( x ) 2 ! h 2 + f ( 3 ) ( c 1 ) 3 ! h 3 ( 2 ) {\displaystyle f(x+h)=f(x)+f^{'}(x)h+{\frac {f^{(2)}(x)}{2!}}h^{2}+{\frac {f^{(3)}(c_{1})}{3!}}h^{3}\quad (2)}
f ( x − h ) = f ( x ) − f ′ ( x ) h + f ( 2 ) ( x ) 2 ! h 2 − f ( 3 ) ( c 2 ) 3 ! h 3 ( 3 ) {\displaystyle f(x-h)=f(x)-f^{'}(x)h+{\frac {f^{(2)}(x)}{2!}}h^{2}-{\frac {f^{(3)}(c_{2})}{3!}}h^{3}\quad (3)}
然後,透過用公式(2)減去公式(3)得到。
f ( x + h ) − f ( x − h ) = 2 f ′ ( x ) h + f ( 3 ) ( c 1 ) 3 ! h 3 + f ( 3 ) ( c 2 ) 3 ! h 3 {\displaystyle f(x+h)-f(x-h)=2f^{'}(x)h+{\frac {f^{(3)}(c_{1})}{3!}}h^{3}+{\frac {f^{(3)}(c_{2})}{3!}}h^{3}}
f ′ ( x ) = f ( x + h ) − f ( x − h ) 2 h + O ( h 2 ) {\displaystyle f^{'}(x)={\frac {f(x+h)-f(x-h)}{2h}}+O(h^{2})}
f ′ ( x ) = f ( x + h ) − f ( x ) h + O ( h ) {\displaystyle f^{'}(x)={\frac {f(x+h)-f(x)}{h}}+O(h)}
f ′ ( x ) = f ( x ) − f ( x − h ) h + O ( h ) {\displaystyle f^{'}(x)={\frac {f(x)-f(x-h)}{h}}+O(h)}
二階導數可以透過將公式 (2) 和 (3) 相加得到(如果適當展開以包含四階導數項)。
f ″ ( x ) = f ( x + h ) − 2 f ( x ) + f ( x − h ) h 2 + O ( h 2 ) {\displaystyle f^{''}(x)={\frac {f(x+h)-2f(x)+f(x-h)}{h^{2}}}+O(h^{2})}