Euler's Formula¶
Euler's formula links the exponential function to circular motion:
$$ e^{ix}=\cos x+i\sin x. $$
We verify the identity coefficient by coefficient. Egison differentiates symbolic expressions to generate the Maclaurin terms on both sides.
Maclaurin expansion of the exponential¶
For a function $F$, the term of degree $n$ at the origin is
$$ \frac{F^{(n)}(0)}{n!}x^n. $$
We first ask for the first eight terms of $e^{ix}$.
declare symbol x : MathValue
take 8 (taylorExpansion (e^(i * x)) x 0)
Real and imaginary parts¶
The even powers occur in $\cos x$, while the odd powers occur in $i\sin x$. Computing the two series separately makes this parity split visible.
take 8 (taylorExpansion (cos x) x 0)
take 8 (taylorExpansion (i * sin x) x 0)
Coefficient-by-coefficient comparison¶
Adding the two lists must reproduce the exponential series through every displayed order.
take 8
(map2 (+)
(taylorExpansion (cos x) x 0)
(taylorExpansion (i * sin x) x 0))
The final list is identical to the expansion of $e^{ix}$. The calculation exhibits Euler's formula as a formal power-series identity, without substituting a numerical value for $x$.