Coordinate systems in physics problem (damped pendulum) 
A simple pendulum of lenght $\ell$ is vibrating freely (with small oscillations). The pendulum is set into forced vibration by moving its point of suspension horizontally with a Simple Harmonic Motion with amplitude $A\ll\ell$. Also, the pendulum is damped so that there exists a drag force $-b\dot x$ acting on the bob ($\gamma=b/m$, $m$ the mass of the bob). Show that if the horizontal displacement of the pendulum bob is $x$, and the horizontal displacement of the support is $\xi$, the equation of motion of the bob for small oscillations is $$\ddot{x}+\gamma\dot x + \frac g\ell x=\frac{g}{\ell}\xi.$$

Typically, to solve a pendulum one uses the angle coordinate $\phi$ which is the angle between $-\hat{\mathbf k}$ (if gravity points towards the negative $z$ axis), and the vector that goes from the support of the pendulum to its bob.
In this case it is very easy (if you are not familiar with pendulums, see here) to see that the differential equation that tells us the story of the pendulum's movement (as viewed from an inertial frame) is:
$$\frac g\ell\phi +\gamma\dot x+\ddot\phi  = 0.$$
If we choose the $x$ axis to be in the plane of movement, then we can measure the movement of the bob and label it by $x$, and the support by $\xi$ as suggested, so that, when there are small oscillations $\phi\approx\sin\phi=\dfrac{x-\xi}{\ell}$. Here I ask my question: why $\ddot\phi=\ddot x/\ell$ instead of $\ddot\phi = \dfrac{\ddot x - \ddot \xi}{\ell}$? I mean, $\xi$ is changing over time, and its motion obbeys SHM.
Thanks for your help :)
A short note: This is exercise 4-5 of the famous Vibrations and Waves text by French.
 A: I will answer my question using the Lagrangian Method. However, if someone could point out what was wrong with my solution (probably it has to be with the solution to the pendulum viewed from the non-inertial frame) that would be great!
The position $r$ of the mass $m$ is:
$$r=\xi\hat{\boldsymbol \imath}+\ell(\sin\phi\hat{\boldsymbol \imath}+\cos\phi\hat{\boldsymbol \jmath}).$$
The kinetic energy of the mass $m$ is given by:
\begin{align}
T&=\frac 12 m \dot r^2 = \frac12m\left(\dot\xi\hat{\boldsymbol \imath}+\ell\dot\phi(\cos\phi\hat{\boldsymbol \imath} - \sin\phi \hat{\boldsymbol \jmath})\right)^2\\
&=\frac12 m\left(\dot\xi^2+\ell^2\dot\phi^2+2\dot\xi\dot\phi\ell\cos\phi\right).
\end{align}
The potential energy is given by:
$$V=-mg\cdot x=-mg(\xi+\ell\cos\phi).$$
The Lagrangian $L=T-V$ is therefore:
$$L(\phi,\dot\phi,t)=\frac12 m\left(\dot\xi^2+\ell^2\dot\phi^2+2\dot\xi\dot\phi\ell\cos\phi\right)+mg(\xi+\ell\cos\phi).$$
Euler-Lagrange equation yields:
\begin{align}0&=-\frac{\partial L}{\partial \phi}+\frac{d}{dt}\frac{\partial L }{\partial \dot\phi}=m\dot\xi\dot\phi\ell\sin\phi+mg\ell\sin\phi+\frac{d}{dt}\left(m\ell^2\dot\phi+m\dot\xi\ell\cos\phi\right)\\
&= m\dot\xi\dot\phi\ell\sin\phi+mg\ell\sin\phi +m\ell^2\ddot\phi+m\ell(\ddot\xi\cos\phi-\dot\phi\dot\xi\sin\phi)\\
&=mg\ell\sin\phi+m\ell^2\ddot\phi+m\ell\ddot\xi\cos\phi.\end{align}
Using the small angles approximation:
$$g\sin\phi+\ell\ddot\phi+\ddot\xi\cos\phi\approx\ell\ddot\phi+g\phi+\ddot\xi=0.$$
Now, as mentioned in the question, we take $\phi\approx\sin\phi = \dfrac{x-\xi}{\ell}$, which produces:
$$\ddot x +\frac g\ell(x-\xi)=0.$$
We can add the term $b\dot x$ to the differential equation to take into account the damping mentioned:
$$m\ddot x = -\frac{mg}{\ell}(x-\xi)-b\dot x\Longrightarrow \ddot x +  \gamma\dot x+\frac g\ell x=\frac g\ell\xi.$$
