Another way to make it feel less coincidental? Differential equations. The function $y=e^x$ satisfies $y'=y$, while $y=\sin x$ and $y=\cos x$ satisfy $y''=-y$. These are fundamental; we could even define the functions based on these equations. Now, the two are obviously different equations - but we don't have to stop there.
Consider the equation $y''=y$. That has both $e^x$ and $e^{-x}$ as solutions, along with linear combinations such as $\sinh x=\frac{e^x-e^{-x}}{2}$ and $\cosh x=\frac{e^x+e^{-x}}{2}$. Now that's looking a lot more like the equation for $\sin$ and $\cos$ - and we can get even closer. What happens with the equation $y''=ay$ for some constant $a$? Well, if $a>0$, we get $y=e^{\sqrt{a}\cdot x}$ and $y=e^{-\sqrt{a}\cdot x}$ as solutions. We can even apply a substitution $t=\sqrt{a}\cdot x$ to transform one to the other. Similarly, for negative $a$, we get $y=\sin(\sqrt{-a}\cdot x)$ and $y=\cos(\sqrt{-a}\cdot x)$ as solutions.
So now, we have a differential equation $y''=ay$, and the form of the solutions changes when the parameter $a$ changes sign. Outside of that change, we have a substitution that can change one case of the equation to another. What happens if we cross the divide, and use the substitution to go from positive to negative $a$? Start with $y''=y$ and it's solutions $y=e^x,y=e^{-x}$. Apply the substitution $y=\sqrt{-1}\cdot x = ix$. The new equation is $y''=-y$, with transformed solutions $y=e^{-it}, y=e^{it}$ - or, at least, those should be solutions to the new equation. But we already know that $y=\cos t$ and $y=\sin t$ are solutions; for things to work out, the new solutions have to be linear combinations of the old and vice versa. Work out the details using values and derivatives at zero, and we get the formulas in the question statement.