I am learning classical physics using the Lagrangian and came across a problem when solving an example.
Suppose you have a spring system, where:
$KE = \frac{1}{2}m(\dot{x})^{2}$
$\ \ \ \ \ and$
$PE = \frac{1}{2}kx^{2}$
The Lagrangian of the system is therefore:
$L \equiv T-U$
$L = \frac{1}{2}m(\dot{x})^{2}-\frac{1}{2}kx^{2}$
Using the Euler-Lagrange equation we can calculate the equation of motion,
$\frac{d}{dt}(\frac{∂L}{∂\dot{x}})=\frac{∂L}{∂x}$
We get,
$m\ddot{x}=-kx$
Therefore, acceleration $\ddot{x}$ must be -$\frac{kx}{m}$
If we integrate the differential equation to solve for the velocity, we get
$\dot{x}=-\frac{k}{m}\int{x}dt$
Here arises my confusion:
How would one integrate $x(t)$ in respect to $t$, if $x(t) =\int{\dot{x}dt}$ or $\ddot{x}$ integrated twice in respect to time
$or$
$-\frac{k}{m}\int{x}dt = -\frac{k}{m}xt$
$m\ddot{x}=-kx\implies \int m(\dot{x}\ddot{x})dt=\int -kx\dot{x}dt$
$m\dot{x}^2/2=-kx^2/2+C$
Worth noting $C$ is a constant of motion, the total energy.
$\dot{x}=\sqrt{2C-kx^2}/\sqrt{m}$
$\frac{dx}{\sqrt{(2C-kx^2)/m}}=dt$
Integrate both sides, the left using trig substitution. Can you take it from there?