# Harmonic oscillator shifted origin

1. Apr 7, 2015

### Runei

Hello,

I'm was going through the simple harmonic oscillator, just as a recap, and I stumbled upon something which is causing me wonder.

I'm solving the SHO with a shifted origin, and so I have the differential equation

$$F=-k(x-x_0)$$
$$\ddot{x}=-\frac{k}{m}x+\frac{kx_0}{m}$$

Now, I get that I can solve the physics problem by simply setting X = x-x_0 and then just adding the normal solution to x_0 to get the position of the particle, however, I was wondering, is it possible to solve the differential equation as it stands above and directly get a solution for x?

2. Apr 7, 2015

### MarcusAgrippa

You can make the problem slightly less trivial by not writing the force as F = - k9X-X_0), but as F = - kx + mg. Now the force doesn't look as if you have simply chosen a bad coordinate, but is the result of the action of two forces. The method of solution is now slightly less obvious, but identical to what you have done: transform the equation by getting rid of the constant term: put X = x - mg/k. This changes the equation to the familiar SHO equation. Mathematicians always attempt to solve the problem that they solved yesterday by converting today's problem into yesterday's.

A different method is as follows.Introduce a new variable $v = \dot{x}$ and then use Newton's trick to change the independent variable from t to x:

$\displaystyle \frac{dv}{dt} = \frac{dv}{dx} \ \frac{dx}{dt} = \frac{dv}{dx} \ v = \frac{d}{dx} \left( \frac{1}{2}\ v^2 \right)$

$\displaystyle m \frac{d}{dx} \left( \frac{1}{2}\ v^2 \right) = -kx + mg$