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

\(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. 码农的转型之路-IoTBrowser(物联网浏览器)雏形上线

    消失了半个月闭门造轮子去了,最近干了几件大事: 1.工控盒子,win10系统长时间跑物联网服务测试.运行快2周了,稳定性效果还满意,除了windows自动更新重启了一次. 2 .接触了一些新概念MQT ...

  2. 【LINT】cpplint 分析笔记

    cpplint 分析笔记 · [前提得看下google规范] @2022-1-13 20:44:48 error message formate: [filename] [linenum] [mess ...

  3. 【MicroPython】用 c 添加接口 -- 添加 type

    [来源]https://www.eemaker.com/micropython-type.html

  4. blackbox的简单学习-监控web服务是否正常以及证书过期时间

    blackbox的简单学习-监控web服务是否正常以及证书过期时间 下载blackbox https://github.com/prometheus/blackbox_exporter 可以在rele ...

  5. Redis监控方法之二

    Redis监控方法之二 背景 前期整理过使用 exporter + prometheus 方式进行Redis监控的搭建过程 最近给同事研究clickhouse时发现 clickhouse 有对应的pl ...

  6. [转帖]oracle数据库中RMAN备份格式化format解释

    格式化解释: 使用格式串 更改格式命令: RMAN> configure channel device type disk format ' E:\app\Administrator\db_ba ...

  7. CPU算力提升与实际性能提升的关系

    关于SPEC2006CPU和RedisBenchmark的理解 最近研究过硬件CPU的性能和Redis这样单线程重IO服务 突然想对比一下CPU算力提升占Redis性能提升的比率情况 性能很大程度由C ...

  8. [转帖]12.JVM运行时数据区之虚拟机栈概述

    https://blog.csdn.net/u011069294/article/details/107050001 目录 1. 内存中的栈与堆 2.栈的优点 1. 内存中的栈与堆 栈是运行时单位,堆 ...

  9. SQLServer 隔离级别的简单学习

    SQLServer 隔离级别的简单学习 背景 上周北京一个项目出现了卡顿的现象. 周末开发测试加紧制作测试发布了补丁,但是并没有好转. 上周四时跟研发訾总简单沟通过, 怀疑是隔离级别有关系.但是不敢确 ...

  10. Oracle TNS 异常问题处理

    今天下午快下班时同事找我说自己的性能测试Oracle数据库 连不上了. 然后自己连上去简单看了一下. 因为已经是事后了, 所以没有截图,只通过文字说明. 环境说明:Win2012r2 + Oracle ...