常用的麦克劳林级数展开式(泰勒展开式)

n = 0 , 1 , 2 , … 一般取到 x 的 3 ∼ 4 次方 n=0,1,2,\dots一般取到x的3\sim4次方 n=0,1,2,一般取到x34次方

  • e x = 1 + x 1 ! + x 2 2 ! + ⋯ + x n n ! + ο ( x n ) e^x=1+\displaystyle\frac{x}{1!}+\frac{x^2}{2!}+⋯+\frac{x^n}{n!}+\omicron(x^n) ex=1+1!x+2!x2++n!xn+ο(xn)
  • ln ⁡ ( 1 + x ) = x − x 2 2 + x 3 3 + ⋯ + ( − 1 ) n − 1 n x n + ο ( x n ) \ln{(1+x)}=x-\displaystyle\frac{x^2}{2}+\frac{x^3}{3}+⋯+\frac{(-1)^{n-1}}{n}x^n+\omicron(x^n) ln(1+x)=x2x2+3x3++n(1)n1xn+ο(xn)
  • sin ⁡ x = x − x 3 3 ! + x 5 5 ! + ⋯ + ( − 1 ) n ( 2 n + 1 ) ! x 2 n + 1 + ο ( x 2 n + 1 ) \sin x=x-\displaystyle\frac{x^3}{3!}+\frac{x^5}{5!}+⋯+\frac{(-1)^{n}}{(2n+1)!}x^{2n+1}+\omicron(x^{2n+1}) sinx=x3!x3+5!x5++(2n+1)!(1)nx2n+1+ο(x2n+1)
  • cos ⁡ x = 1 − x 2 2 ! + x 4 4 ! + ⋯ + ( − 1 ) n ( 2 n ) ! x 2 n + ο ( x 2 n ) \cos x=1-\displaystyle\frac{x^2}{2!}+\frac{x^4}{4!}+⋯+\frac{(-1)^{n}}{(2n)!}x^{2n}+\omicron(x^{2n}) cosx=12!x2+4!x4++(2n)!(1)nx2n+ο(x2n)
  • t a n x = x + 1 3 x 3 + 1 5 x 5 + ⋯ + 1 2 n + 1 x 2 n + 1 + ο ( x 2 n + 1 ) tanx=x+\displaystyle\frac{1}{3}x^3+\frac{1}{5}x^5+\cdots+\frac{1}{2n+1}x^{2n+1}+\omicron(x^{2n+1}) tanx=x+31x3+51x5++2n+11x2n+1+ο(x2n+1)
    推导: ( tan ⁡ x − x ) ∼ 1 3 x 3 ∼ ( x − arctan ⁡ x ) ( x − sin ⁡ x ) ∼ 1 6 x 3 ∼ ( arcsin ⁡ x − x ) α ∼ β ⇒ α = β + ο ( β ) 得  tan ⁡ x = x + 1 3 x 3 + ο ( x 3 ) 同理  arctan ⁡ x , arcsin ⁡ x \begin{aligned} 推导:&(\tan x -x)\sim\displaystyle\frac{1}{3}x^3\sim(x-\arctan x)\\ &(x−\sin x) \sim\displaystyle\frac{1}{6}x^3 \sim (\arcsin x−x)\\ &\alpha \sim \beta \Rightarrow \alpha=\beta+\omicron(\beta)\\ &得\ \tan x=x+\displaystyle\frac{1}{3}x^3+\omicron(x^3)\\ &同理\ \arctan x,\arcsin x &&&&&&&&&&&&&&&&&&&&&&&&&&&&& \end{aligned} 推导:(tanxx)31x3(xarctanx)(xsinx)61x3(arcsinxx)αβα=β+ο(β) tanx=x+31x3+ο(x3)同理 arctanxarcsinx
  • 1 1 − x = 1 + x + x 2 + ⋯ + ο ( x n ) \displaystyle\frac{1}{1-x}=1+x+x^2+\cdots+\omicron(x^n) 1x1=1+x+x2++ο(xn)
  • 1 1 + x = 1 − x + x 2 + ⋯ + ( − 1 ) n x n + ο ( x n ) \displaystyle\frac{1}{1+x}=1-x+x^2+\cdots+(-1)^nx^n+\omicron(x^n) 1+x1=1x+x2++(1)nxn+ο(xn)
  • ( 1 + x ) a = 1 + a 1 ! x + a ( a − 1 ) 2 ! x 2 + ⋯ + a ( a − 1 ) ⋯ ( a − n + 1 ) n ! x n + ο ( x n ) (1+x)^a=1+\displaystyle\frac{a}{1!}x+\frac{a(a-1)}{2!}x^2+\cdots+\frac{a(a-1)\cdots(a-n+1)}{n!}x^n+\omicron(x^n) (1+x)a=1+1!ax+2!a(a1)x2++n!a(a1)(an+1)xn+ο(xn)
  • arcsin ⁡ x = x + 1 2 × x 3 3 + 1 × 3 2 × 4 × x 5 5 + o ( x 5 ) = x + x 3 6 + ο ( x 3 ) \arcsin x=x+\displaystyle\frac{1}{2}\times\frac{x^3}{3}+\frac{1\times3}{2\times4}\times\frac{x^5}{5}+o(x^5)=x+\frac{x^3}{6}+\omicron(x^3) arcsinx=x+21×3x3+2×41×3×5x5+o(x5)=x+6x3+ο(x3)
  • arctan ⁡ x = x − x 3 3 + x 5 5 + ⋯ + ( − 1 ) n 2 n + 1 x 2 n + 1 + ο ( x 2 n + 1 ) \arctan x=x-\displaystyle\frac{x^3}{3}+\frac{x^5}{5}+⋯+\frac{(-1)^{n}}{2n+1}x^{2n+1}+\omicron(x^{2n+1}) arctanx=x3x3+5x5++2n+1(1)nx2n+1+ο(x2n+1)
在C语言中,麦克劳展开式(Maclaurin Series)是数学中的一个重要概念,它用于将复杂的函数表示为无穷级数的和,通常在函数解析学中有应用。对于特定的可导函数,如三角函数、指数函数等,我们可以找到它们在0处的展开式。例如,e的x次方的泰勒展开就是一个常见的麦克劳级数。 以下是一个简单的示例,展示如何使用C语言编写一个函数来计算e的x次方的前n项麦克劳展开: ```c #include <stdio.h> #include <math.h> // 计算第n项的麦克劳系数 double taylor_coefficient(int n, double x) { return factorial(n) / (n * pow(x, n)); } // 计算麦克劳展开,假设只保留n项 double mac_laurin_expansion(double x, int n) { double result = 1.0; for (int i = 1; i <= n; i++) { result += taylor_coefficient(i, x); } return result; } // 计算阶乘 unsigned long long factorial(int n) { if (n == 0 || n == 1) { return 1; } unsigned long long fact = 1; for (int i = 2; i <= n; ++i) { fact *= i; } return fact; } int main() { double x = 0.1; // 示例值,你可以替换为你想要计算的x值 int n = 5; // 展开项数 double expansion = mac_laurin_expansion(x, n); printf("e^%f (approximated with %d terms) is: %.9f\n", x, n, expansion); return 0; } ``` 在这个示例中,我们定义了一个函数`mac_laurin_expansion`来计算麦克劳展开,利用了泰勒系数公和阶乘函数。注意,实际应用中可能需要优化算法,因为直接计算所有项可能会有精度问题,特别是当x非常接近0时。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值