How can a $\sin x$ come out of the equation $\frac{d^2}{dx^2}f(x)=-f(x)$ as the solution, while there's no sign of a trigonometric function in it?

You might in a related way ask "how does a radical show up in the solution to $x^2 + 3x + 7 = 0$?" or "How does a fraction show up in the solution to $3x + 2 = 9$?

There were no square roots in the first equation, and no fractions in the second...

The answer, to some degree, is that "sine and cosine are the names we give to the fundamental class of solutions to 2nd order linear ODEs with constant coefficients and the right sort of discriminant," and that "exponentials are the name we give to a class of functions that satisfy linear first order differential equations with constant coefficients."

Now you might say "Wait a minute! Sines and cosines come from triangles! And exponentials come from ... well...taking powers of 2, for instance!"

But those powers of two can be related to a discrete version of the differential equation that defines exponentials, and (with more work) things having to do with triangles and circles can be tied to the constant coeff diff. eqns that produce sines and cosines. So it's really a chicken and egg problem.

But I'll stand back for a moment and agree with you: it is surprising at first, and delightful, to see these disparate things related.


Using the differential equation to get a recursion for a power series expansion for solutions, and recognizing the power series expansion of sine and/or cosine, succeeds.

An approach that avoids power series, and avoids exponential functions: write $y''=-y$ as $d(y')/dx=-y$, multiply by $1/{dy\over dx}$ to have (heuristically!) $d(y')/dy=-y/y'$ and then $y'\,dy'=-y\,dy$. Integrate to $(y')^2=C-y^2$. Taking $C=1$ and multiplying through by $dx$ (!), this gives $dy/\sqrt{1-y^2}=dx$, which integrates to $\arcsin y=x+C$. :)


Even without using complex numbers, one can show the solution $y(x)$ of the equation, which satisfies the initial conditions $y(0)=0,\;y'(0)=1$ is necessarily periodic, first increases, then decreases, then increases gain.

The theory of trigonometric functions can be entirely based on this differential equation. If I remember well, it is an exercise in M. Spivak's Calculus.

I'll show this equation ‘contains’ the seeds of all properties of trigonometric functions on a simple example: we have $$y^2+y'^2=1.$$ Indeed, the derivative of the l.h.s. is $$$2yy'+2y'y''=2yy'-2y'y=0,$$ hence by the Mean value theorem, $y^2+y'^2$ is a constant function. This constant is equal to $y(0)+y'(0)=1$.

Note

If you interpret the equation $y''+y=0$ as the equation which rules a mechanical system such as a pendulum, the relation $y^2+y'^2=\sin^2x+\cos^2x=1$ is but the law of conservation of energy.