# 欧拉公式

#### 欧拉公式（Euler's Formula）

$e^x =1+frac{x}{1!}+frac{x^2}{2!}+dots = sum_{k = 0}^{infty}frac{x^k}{k!}$

$sin(x) = frac{x}{1!}-frac{x^3}{3!}+frac{x^5}{5!}-frac{x^7}{7!}+dots = sum_{k = 0}^{infty}{(-1)}^kfrac{x^{(2k+1)}}{(2k+1)!}$
$cos(x) = frac{x^0}{0!}-frac{x^2}{2!}+frac{x^4}{4!}-frac{x^6}{6!}+dots = sum_{k = 0}^{infty}{(-1)}^kfrac{x^{2k}}{(2k)!}$

$i^0=1,quad i^1=i,quad i^2=-1,quad i^3=-i$
$i^4=1,quad i^5=i,quad i^6=-1,quad i^7=-i$

$ix$带入指数函数的公式中，我们获得：
$e^{ix}=frac{(ix)^0}{0!}+frac{(ix)^1}{1!}+frac{(ix)^2}{2!}+frac{(ix)^3}{3!}+frac{(ix)^4}{4!}+frac{(ix)^5}{5!}+frac{(ix)^6}{6!}+frac{(ix)^7}{7!}+dots$
$qquad =frac{i^0x^0}{0!}+frac{i^1x^1}{1!}+frac{i^2x^2}{2!}+frac{i^3x^3}{3!}+frac{i^4x^4}{4!}+frac{i^5x^5}{5!}+frac{i^6x^6}{6!}+frac{i^7x^7}{7!}+dots$
$qquad = 1frac{x^0}{0!}+ifrac{x^1}{1!}-1frac{x^2}{2!}-ifrac{x^3}{3!}+1frac{x^4}{4!}+ifrac{x^5}{5!}-1frac{x^6}{6!}-ifrac{x^7}{7!}+dots$
$qquad = (frac{x^0}{0!}-frac{x^2}{2!}+frac{x^4}{4!}-frac{x^6}{6!}+dots)+i(frac{x}{1!}-frac{x^3}{3!}+frac{x^5}{5!}-frac{x^7}{7!}+dots)$
$qquad = cos(x)+isin(x)$

$frac{d}{dx}e^x=e^x$

$frac{d}{dx}sin(x)=cos(x)$

$frac{d}{dx}cos(x)=-sin(x)$