Focusing on quaternions really sends you off into a rabbit hole about imaginary numbers. Mathematician Euler must’ve thought so too, so let’s tear apart his equation:
e^ix = cosx + i*sinx
So the exponential function, “e to the i times x” where i is imaginary and x is real gives you the cosine of x plus the sine of x times i. While this seems like an awfully random equation, the derivation is rather straightforward. Functions, especially non-algebraic ones like exponentials, can be rewritten as algebraic terms added together in power series. The power series for the generic exponential function is as shown:
By adding more terms, the algebraic approximation comes closer to the actual value of the function, so writing to x^n/n! where n is a big number gets you pretty close to e^x. Simply give x any value and plug into e^x and compare it to substituting a value for x in the series.
In this example, the approximation used four terms and gives an answer of about 6.333 while e^2 is about 7.389. The answers are close, albeit not exact. Doing 20 terms would bring us a lot closer to the exact value of e^2.
With that in mind, let’s set x equal to i*x as seen in Euler’s equation. Doing that gives this series and we can use i^2=-1 to simplify:
More terms were added to show a developing pattern. Terms that have x raised to an odd power have an i while the even power terms do not have i. You can rewrite the series to show all the even terms and the odd terms. The nth term is assumed to be even, so the odd group goes the n+1 value since any even number plus one is an odd number.
Soup-headed math nerds may recognize something more than this pattern of even and odds with alternating signs of positive and negative. Look at the power series for cosine and sine:
The even terms of the e^ix series are exactly the terms for cosx! Seeing the sine part is a bit more tricky, but factoring out the i makes the series more noticeable.
The fact that these specific series appear is no simple coincidence. We can rewrite our initial exponential as shown:
This is exactly Euler’s equation. This is used for more than just soup-ifying brains, however, which brings me back to the last post’s concept. Imaginary numbers rotate real values in the complex plane. This formula can be used to determine the real and imaginary components of a vector.
Right triangle trigonometry allows us to use cosine and sine to determine the horizontal (real) and vertical (imaginary) components of a vector. The example used has length 1, but the length can be any value. This means that a vector can be rewritten in terms of cosine, and sine rather than in the form of a+bi
Imaginaries are so very real in math.
Stay Soupy.