Suppose I have a smooth potential $U:\mathbb R\to\mathbb R$ with $U(x)=U(-x)$, $U(0)=0$, and $U'(x)>0$ for $x>0$. A particle of mass $1$ at rest at position $x=x_0$ has total energy $U(x_0)$, and if allowed to move freely in the potential well will have periodic motion with period $$T(x_0)=4\int_0^{x_0}\frac{dx}{\sqrt{2(U(x_0)-U(x))}}.$$ So if $U(x)$ is known, we can calculate $T(x)$. I want to invert this process to find $U(x)$ if $T(x)$ is known for all $x$. I would appreciate a hint on where to start this derivation.
One idea is to take the derivative of $T(x_0)$. Naively, we would expect the derivative to take the form $$\frac{dT}{dx_0}=4\left(\int_0^{x_0}\left(\frac{d}{dx_0}\frac{1}{\sqrt{2(U(x_0)-U'(x))}}\right)\,dx+\frac{1}{\sqrt{2(U(x_0)-U(x))}}\Bigg|_{x=x_0}\right).$$ But we notice that the integral doesn't converge, and the other term is undefined. Hopefully, the two singularities cancel. I think the right way to deal with this is to write $$T(x_0)=\lim_{a\to x_0^-}4\int_0^a\frac{dx}{\sqrt{2(U(x_0)-U(x))}},$$ and then take the derivative. However, I am unable to evaluate the derivative, and even if I did, I don't know if this method will ultimately work.