$ L= \frac{ \color{blue}{m}}{2} \left( \color{olive}{\frac{dx}{dt}}\right)^2 - \frac{ \color{red}{k}}{2} \color{magenta}{x}^2$
A harmonic oscillator simply consists of an object attached to a spring and is one of the simplest physical systems we can study.
To describe the system we usually track the $\color{magenta}{\text{position}}$ of the object at the end of the spring. The continuous up and down movement is called an oscillation, which is where the name "oscillator" comes from.
The movement depends crucial on the $\color{red}{\text{properties of the spring}}$. When the spring is harder, the movements of the object will be smaller. In addition, the motion of the object depends on its $\color{blue}{\text{mass}}$. A heavier object will perform larger swings.
“The career of a young theoretical physicist consists of treating the harmonic oscillator in ever-increasing levels of abstraction.” Sidney Coleman
In a sense, the harmonic oscillator is to physics what the set of natural numbers is to mathematics. It is a simple, almost “trivial” system, but one which conceals much subtlety and beauty and from which a great deal of what is of interest in the subject evolves. Gregory L. Naber
The harmonic oscillator is an important model system pervading many areas in classical physics; it is likewise ubiquitous in quantum mechanics. The nonrelativistic Scrodinger equation with a harmonic oscillator potential is readily ¨ solved with standard analytic methods, whether in one or three dimensions. However, we will take a different tack here, and address the one-dimension problem more as an excuse to introduce the notion of “creation” and “annihilation” operators, or “step-up” and “step-down” operators. This is an example of a type of operation which will repeat itself in many contexts, including the theory of angular momentum.
The Simple Harmonic Oscillator by F. Porter