# Lagrangian mechanics, one-dimensional simple harmonic oscillator [closed]

Question

Consider a one-dimensional simple harmonic oscillator, i.e. a particle moving in a potential, $$u(x)=\frac{k}{2}x^2$$

(a) Explain why energy is conserved and solve the problem by reducing to a one-dimensional integral.

(b) Obtain a direct solution of problem 1(a) by obtaining Lagrangian and from it the equations of motion, then solving the equations of motion directly. Express any symbols you introduce in terms of physical quantities.

An Attempt at the solution

As provided by user below: $$\mathcal{L} = T - U = \frac{1}{2}m\dot{x}^2 - \frac{1}{2}kx^2$$ Euler-Lagrange tell us $$\frac{\partial \mathcal{L}}{\partial x} = \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{x}}$$

here, $$\frac{\partial \mathcal{L}}{\partial x} = -kx$$ $$\frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{x}} = \frac{d}{dt} (m\dot{x}) = m\ddot{x}$$

and so $$m\ddot{x} = -kx$$

I have found the solution of this differential equation to be $$x(t) = c_1 \cos\left(\sqrt{\frac{k}{m}} t \right) + c_2 \sin\left(\sqrt{\frac{k}{m}} t\right).$$ My Problem

I was just wondering if you could explain to me the significance of the constants. I am thinking that I am unable to determine them without some initial condition (which in this question I am not given) so hence am unable to 'simplify' further?

However, I have seen that looking at time, $t=0$, gives $x_0=c_1$, which would be simply saying that $c_1$ is the initial postion. I can similarly guess that $t=\sqrt{\frac{m}{k}}\left(\frac{n\pi}{2}\right)$, would give $c_2=x(\sqrt{\frac{m}{k}}\left(\frac{n\pi}{2}\right))$. However, this second part is clearly not constant so I clearly can not do this. My question is, can I find this condition (if I am even correct in doing this in the first place?)

## closed as off-topic by Kyle Kanos, Chris♦, John Duffield, stafusa, Emilio PisantyMar 1 '18 at 10:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – Kyle Kanos, Chris, John Duffield, stafusa, Emilio Pisanty
If this question can be reworded to fit the rules in the help center, please edit the question.

• Have you taken any courses on ODEs? – Kyle Kanos Mar 2 '18 at 11:16

HINT For this problem the kinetic energy is

$$T = \frac{1}{2}m \dot{x}^2$$

and recall that

$$L = T - U$$

I'll help out with (b)

$$\mathcal{L} = T - U = \frac{1}{2}m\dot{x}^2 - \frac{1}{2}kx^2$$ Euler-Lagrange tell us $$\frac{\partial \mathcal{L}}{\partial x} = \frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{x}}$$

here, $$\frac{\partial \mathcal{L}}{\partial x} = -kx$$ $$\frac{d}{dt} \frac{\partial \mathcal{L}}{\partial \dot{x}} = \frac{d}{dt} (m\dot{x}) = m\ddot{x}$$

and so $$m\ddot{x} = -kx$$

which has a sinusoidal solution.

• I was just wondering if you could explain to me the significance of the constants. I am thinking that I am unable to determine them without some initial condition (which in this question I am not given) so hence am unable to 'simplify' further? – George Mar 2 '18 at 3:11
• However, I have seen that looking at time, $t=0$, gives $x_0=c_1$, which would be simply saying that $c_1$ is the initial postion. I can similarly guess that $t=\sqrt{\frac{m}{k}}\left(\frac{n\pi}{2}\right)$, would give $c_2=x(\sqrt{\frac{m}{k}}\left(\frac{n\pi}{2}\right))$. However, this second part is clearly not constant so I clearly can not do this. My question is, can I find this condition (if I am even correct in doing this in the first place?) – George Mar 2 '18 at 3:11
• I'm not sure I understand your question. The constants $m$ and $k$ represent the mass and the spring constant, respectively, but I don't think thats your question. You could solve the ODE and get $y(x) = C_1 \sin{\omega x} + C_2 \cos{\omega x}$ (here, $\omega = -\sqrt{k/m}$). The arbitrary constants $C_1$ and $C_2$ can only be determined by some initial condition - you cannot simplify the solution any further without any initial conditions. – talrefae Mar 2 '18 at 17:32