欧拉公式是数学中最重要的公式之一, 它涉及到了复数, 无理数, 三角函数, 简单优美

\(e^{i\theta} = cos(\theta) + isin(\theta)\)

欧拉公式代表的含义并不是欧拉最先发现的, 1714年英国物理学家和数学家罗杰·柯茨在一个公式中建立了对数, 三角函数和虚数之间的关系, 在1740年前后, 欧拉通过另一种形式得到了等价的公式.

\(i\theta = ln\left(cos(\theta) + isin(\theta)\right)\)

如果把 \(\theta\) 的值特殊化为 \(\theta = \pi\),就得到了欧拉恒等式

\(e^{\pi i} = -1\)

自然常数e

自然常数e是一个特殊的常数, 它的特性是 $ \left ( e^{x} \right )' = e^{x} $, 即指数函数的导数还是自身

e的定义如下

$ e = \lim_{x \to 0} (1 + x)^{\frac{1}{x}} $



$ e = \lim_{x \to \infty} (1 + \frac{1}{x})^{x}$

这个极限收敛, 值约为2.71828

对 \(e^x\) 的导数不变性的证明:

因为当e趋于无穷小时, $ e = \lim_{x \to 0} (1 + x)^{\frac{1}{x}} $ (这里实际上包含一个物理意义, 在 \(\lim_{x \to 0}\) 时 \(e^x\) 和 \(y=x\) 的曲线是无限接近的)

对其变形可得

$ e^x = lim_{x \to 0}1 + x$,

$ x = lim_{x \to 0}e^x - 1$,

$ 1 = lim_{x \to 0} \frac{e^{x} - 1}{x}$,

于是根据导数的定义,对于 \(e^x\), 我们给自变量x一个微小增量dx,可以得到

\(y' = \frac{e^{(x+dx)}-e^{x}}{dx}\)

\(= \frac{e^x * e^{dx} - e^x}{dx}\)

\(= e^x * \frac{e^{dx} - 1}{dx}\), 将上面的等式代入

$= e^x * 1 = e^x = y $

自然常数e的指数函数

\(f(x) = e^x\) 的泰勒级数展开

\(exp(x) = 1 + \frac{x^1}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + ... = \sum_{i=0}^{n} \frac{x^n}{n!}\)

当 \(x = i\theta\) 时, \(exp(i\theta)\) 就成为了复平面上的一个圆

\(e^{i(0 + 2n\pi)} = 1\)

\(e^{i(\frac{\pi}{2} + 2n\pi)} = i\)

\(e^{i(\pi + 2n\pi)} = -1\)

\(e^{i(\frac{3\pi}{2} + 2n\pi)} = -i\)

数值验证

用一小段c代码验证 \(e^{i(\pi + 2n\pi)} = -1\)

#define PI      3.1415926
#define STEP 18 int main(void)
{
int32_t i = 0;
int64_t factorial = 1;
double real = 1, imaginary = 0, pp = 1, curr;
for (i = 0; i < STEP; i++)
{
pp = pp * PI;
factorial = factorial * (i + 1);
curr = pp / factorial;
if (i % 4 == 0) imaginary += curr;
else if (i % 4 == 1) real -= curr;
else if (i % 4 == 2) imaginary -= curr;
else real += curr;
printf("%3d - %20.6f / %25lu = %f, %10f %10f\r\n", i, pp, factorial, curr, real, imaginary);
}
}

当step为18时, 其输出为

  0 -             3.141593 /                         1 = 3.141593,   1.000000   3.141593
1 - 9.869604 / 2 = 4.934802, -3.934802 3.141593
2 - 31.006275 / 6 = 5.167713, -3.934802 -2.026120
3 - 97.409084 / 24 = 4.058712, 0.123910 -2.026120
4 - 306.019659 / 120 = 2.550164, 0.123910 0.524044
5 - 961.389095 / 720 = 1.335263, -1.211353 0.524044
6 - 3020.292867 / 5040 = 0.599264, -1.211353 -0.075221
7 - 9488.529721 / 40320 = 0.235331, -0.976022 -0.075221
8 - 29809.094757 / 362880 = 0.082146, -0.976022 0.006925
9 - 93648.031501 / 3628800 = 0.025807, -1.001829 0.006925
10 - 294203.962770 / 39916800 = 0.007370, -1.001829 -0.000445
11 - 924268.992327 / 479001600 = 0.001930, -0.999900 -0.000445
12 - 2903676.626705 / 6227020800 = 0.000466, -0.999900 0.000021
13 - 9122169.003250 / 87178291200 = 0.000105, -1.000004 0.000021
14 - 28658138.636560 / 1307674368000 = 0.000022, -1.000004 -0.000001
15 - 90032196.270391 / 20922789888000 = 0.000004, -1.000000 -0.000001
16 - 282844481.564807 / 355687428096000 = 0.000001, -1.000000 0.000000
17 - 888582130.234833 / 6402373705728000 = 0.000000, -1.000000 0.000000

应用

欧拉公式中, \(cos(\theta)\)是实部, \(sin(\theta)\)是虚部, 分别可以表示为

\(cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} + ... = \sum_{i=0}^{n} (-1)^n\frac{x^{2n}}{2n!}\)

\(sin(x) = \frac{x^1}{1!} - \frac{x^3}{3!} + \frac{x^5}{5!} - ... = \sum_{i=0}^{n} (-1)^n\frac{x^{2n + 1}}{(2n+1)!}\)

这样就建立了三角函数和普通指数运算的桥梁, 在计算机上, 计算三角函数 sin, cos 以及其派生出的其他数值, 都可以通过泰勒级数进行计算, 根据需要可以通过循环次数控制精度.

参考

欧拉公式 Euler's Formula的更多相关文章

  1. Trying to find the anti-derivative of $\tan x$ unsuccessfully by using Euler's formula

    We know that$$\tan t=\frac{e^{it}-e^{-it}}{i(e^{it}+e^{-it})}=\frac{e^{2i    t}+1-2}{i(e^{2it}+1)}=- ...

  2. 数学常数e的含义

    转载:   http://www.ruanyifeng.com/blog/2011/07/mathematical_constant_e.html 作者: 阮一峰 日期: 2011年7月 9日 1. ...

  3. $\mathcal{OI}$生涯中的各种数论算法的证明

    嗯,写这个是因为我太弱了\(ORZ\). #\(\mathcal{\color{silver}{1 \ \ Linear \ \ Sieve \ \ Method \ \ of \ \ Prime}} ...

  4. 《Shazam It! Music Recognition Algorithms, Fingerprinting, and Processing》译文

    最近看到一篇老外写的博客,简单介绍了shazam的工作原理.图非常好,所以就把它翻译成中文,希望对搞听歌识曲的人有帮助. 你可能遇到这样的场景:在酒吧或者餐厅听到你非常熟悉的歌,也许你曾经听过无数次, ...

  5. Data Visualization – Banking Case Study Example (Part 1-6)

    python信用评分卡(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_camp ...

  6. Mathematics for Computer Science (Eric Lehman / F Thomson Leighton / Albert R Meyer 著)

    I Proofs1 What is a Proof?2 The Well Ordering Principle3 Logical Formulas4 Mathematical Data Types5 ...

  7. 五、c++实现离散傅里叶变换

    C++离散傅里叶变换 一.序言: 该教程基于之前的图像处理类MYCV,是对其的补充. 二.设计目标 对图像进行简单的离散傅里叶变换,并输出生成的频谱图. 三.需要提前掌握的知识 二维傅里叶变换公式: ...

  8. Circle Problem From 3Blue1Brown (分圆问题)

    Background\text{Background}Background Last night, lots of students from primary school came to our c ...

  9. Game Engine Architecture 13

    [Game Engine Architecture 13] 1.describe an arbitrary signal x[n] as a linear combination of unit im ...

  10. poj2284 That Nice Euler Circuit(欧拉公式)

    题目链接:poj2284 That Nice Euler Circuit 欧拉公式:如果G是一个阶为n,边数为m且含有r个区域的连通平面图,则有恒等式:n-m+r=2. 欧拉公式的推广: 对于具有k( ...

随机推荐

  1. idea侧边栏commit消失

    1.问题 在使用Clion中想要查看提交的相关信息,发现侧边栏commit消失 2.解决方法 打开设置,选择会用非模式提交界面即可

  2. WebApi允许跨域

    services.AddCors(options => { options.AddPolicy("abc", builder => { //App:CorsOrigin ...

  3. [转帖]使用 Logical Import Mode

    https://docs.pingcap.com/zh/tidb/v6.5/tidb-lightning-logical-import-mode-usage 配置及使用 可以通过以下配置文件使用 Lo ...

  4. [转帖]数据库系列之TiDB存储引擎TiKV实现机制

    TiDB存储引擎TiKV是基于RocksDB存储引擎,通过Raft分布式算法保证数据一致性.本文详细介绍了TiKV存储引擎的实现机制和原理,加深对TiDB底层存储架构的理解. 1.TiDB存储引擎Ti ...

  5. [转帖]configure: error: cannot guess build type;you must specify one

    该问题一般出现在国产平台,从错误描述来看,意思是:无法猜测build类型,你必须指定一个. 解决办法: 1. 在系统/usr路径下搜索 config.guess 和 config.sub 这两个文件. ...

  6. [转帖]Optimizing Block Device Parameter Settings of Linux

    https://support.huawei.com/enterprise/en/doc/EDOC1000181485/ddbc0e8b/optimizing-block-device-paramet ...

  7. 玩一玩 VictoriaLogs

    作者:张富春(ahfuzhang),转载时请注明作者和引用链接,谢谢! cnblogs博客 zhihu Github 公众号:一本正经的瞎扯 下载 see: https://github.com/Vi ...

  8. C/C++ 实现常用的线程注入

    各种API远程线程注入的方法,分别是 远程线程注入,普通消息钩子注入,全局消息钩子注入,APC应用层异步注入,ZwCreateThreadEx强力注入,纯汇编实现的线程注入等. 简单编写DLL文件: ...

  9. chrony客户端发送时间戳随机问题

    现象   使用centos8的chrony给本机同步时间时,发现客户端发送给服务器的NTP包中,transmit timestamp(T3)的时间戳是随机的,同时,服务器端收到客户端请求的包后,原封不 ...

  10. 如何在Visual Studio新C++项目中调用之前配置过的库?

      本文介绍在Visual Studio软件中调用C++各种配置.编译完毕的第三方库的方法.   在撰写C++代码时,如果需要用到他人撰写的第三方库(例如地理数据处理库GDAL.矩阵运算库Armadi ...