TITLE: Definition of sine and cosine
QUESTION [6 upvotes]: I've seen Sine and Cosine defined as the unique solution to:
$$\begin{align}
\frac d{dx} \sin(x) &= \cos(x)\\  
\frac d{dx} \cos(x) &= -\sin(x)
\end{align}$$
with $\sin(0) = 0$ and $\cos(0) = 1$.
Is there really only one solution to these functions? How can these functions be defined more formally?

REPLY [9 votes]: Let's decouple the sine and cosine functions by using second derivatives: $\sin x$ is the unique solution of $y''(x) = -y(x)$ where $y(0) = 0$ and $y'(0) = 1$, and $\cos x$ is the unique solution of $y''(x) = -y(x)$ where $y(0) = 1$ and $y'(0) = -1$.  I'll take for granted that they fit these conditions and focus on why such equations have just these solutions.
In particular, I will not make any use of power series or any kind of infinite series representation at all to get the uniqueness result.
Here is a proof for the sine function. Suppose $y''(x) = -y(x)$ where $y(0) = 0$ and $y'(0) = 1$. To prove $y(x) = \sin x$, let $f(x) = y(x) - \sin x$.  We want to show $f(x) = 0$ for all $x$. Differentiating $f$ twice, we get $f''(x) = -f(x)$, $f(0) = 0$, and $f'(0) = 0$. Let's consider the expression $F(x) = f(x)^2 + f'(x)^2$.  This turns out to be constant since its derivative is $0$ (this is analogous to $\sin^2x + \cos^2 x$ being constant, namely $1$):
$$
F'(x) = 2f(x)f'(x) + 2f'(x)f''(x) = 2f(x)f'(x) - 2f'(x)f(x) = 0.
$$
Functions on $\mathbf R$ with derivative $0$ are constant, so $F(x) = c$ for some number $c$ (and all $x$).  We have $F(0) = f(0)^2 + f'(0)^2 = 0^2 + 0^2 = 0$, so $c = 0$.  Thus $F(x) = 0$ for all $x$, so
$$
f(x)^2 + f'(x)^2 = 0.
$$
These are real numbers, so $f(x) = 0$ for all $x$. Thus $y(x) = \sin x$.  A similar argument proves a more general result mentioned in the answer by xyz: if $y''(x) = -y(x)$ with $y(0) = a$ and $y'(0) = b$ then $y(x) = a\cos x + b\sin x$.  The converse is easy (granting we know what $\sin x$ and $\cos x$ are, of course).
I learned this slick argument from Spivak's Calculus. See Theorem 4 of Chapter 15 ("The Trigonometric Functions").