Finding the period of an anharmonic oscillation by substituting the solution for SHM I came across the problem below, and I am confused about the solution provided.
The solution method is to substitute the result for SHM into an equation which is not harmonic, and rearrange to find how period depends on amplitude. An intermediate result is that $\omega=\sqrt{3kx/m}$.  If angular frequency $\omega$ is a function of the distance $x$ from mean position then how can the motion be simple harmonic? Moreover, how is the differential equation #2 for SHM satisfied by the force in eqn #1?
The method does not seem to be valid. Nevertheless, it gives the correct answer for all potentials of the form $V=k|x|^n$ (A in this case). 
If this method is valid, what is the justification for it? 
My question is not a duplicate of that suggested by Qmechanic, viz. Non-SHM oscillatory motion. Although both questions are based on exactly the same problem, I am asking about the validity of the method used in the image below.

 A: Your doubts about the solution given are justified. The method of solution seems to be invalid and misguided - but see my footnote. However, the correct answer choice is still (A). 
If the potential energy is $V=k|x|^3$ then (as you observe) the motion is not simple harmonic and cannot be described by $x=A\sin(\omega t)$. The differential equation of motion is
$$m\frac{d^2x}{dt^2}+3kx^2=0$$
which is not of the form $$\frac{d^2x}{dt^2}+\omega^2 x=0\,.$$ 
The equation of motion does not have a simple solution. However, we can proceed as in Period $T$ of oscillation with cubic force function. We can write the conservation of energy for the oscillator as
\begin{align}\frac12m\dot x^2+k|x|^3 &=ka^3\\  
\implies~~~~~~~~~~~~~~~~~~~~ \dot x^2 &=\frac{2k}{m}\left(a^3-|x|^3\right)\end{align}
where $a$ is the amplitude. Change variables to $x=ay$. Then :
\begin{align}a^2\dot y^2 &=\frac{2k}{m}a^3\left(1-|y|^3\right)\\\implies ~ \frac{dy}{dt} &=\sqrt{\frac{2k}{m}a\left(1-|y|^3\right)}\,.\end{align}
The oscillation is symmetric about the equilibrium point, so the period is given by
$$T=\int dt=4\sqrt{\frac{m}{2ka}}\int_0^1 \frac{1}{\sqrt{1-y^3}}~dy\,.$$
Contrary to appearances, the integral is finite and has a value of approx. 1.40218.
So the period is proportional to $\frac{1}{\sqrt{a}}$ and the answer is (A), but not for the reason given in the solution. 

Note : The method of solution in the image text does actually give the correct dependence of $T$ on amplitude $a$ for any potential of the form $k|x|^n$. So perhaps there is some justification for it.
A: The problem and its generalization to the potential $V =\frac{k}{n}|x|^n$ can be solved by dimensional analysis, cf. e.g. this Phys.SE answer, so even if one writes down wrong equations, e.g.,
$$ x ~=~ a \sin\omega t ,\qquad\qquad\qquad (\longleftarrow \text{Wrong!}) $$
as long as they are dimensional meaningful, e.g.,
$$ [x] ~=~ [a \sin\omega t]~=~[a] ,\qquad\qquad (\longleftarrow \text{Correct!}) $$
then one is bound to arrive at the correct result. 
A: You complain that the solution posits an equation of motion
\begin{align}
x(t) &\sim a\sin\omega t
\tag1
\\
x''(t) & \sim -\omega^2 a\sin\omega t
\tag2
\end{align}
which is the solution to the simple harmonic oscillator $mx'' = -kx$, 
not to your anharmonic oscillator $mx'' = -kx^2$.  Which is a valid criticism.
However, if you make the reasonable assumption that the motion will be periodic, then Fourier analysis tells us that the solution can be written in the form
\begin{align}
x(t) &= a_1\sin\omega t + a_2 \sin 2\omega t + \cdots 
+ b_3 \cos3\omega t + \cdots
\\
x''(t) &= -\omega^2 \left(
a_1\sin\omega t + 2^2 a_2 \sin 2\omega t + \cdots
+ 3^2 b_3 \cos3\omega t + \cdots
\right)
\end{align}
where the ellipsis includes perhaps some cosine terms as well.
Finding all the Fourier coefficients so that the sum in parentheses is the square of the first line is a straightforward, if tedious, problem.
But if you have some experience with Fourier series, you'll know to expect that the low-frequency coefficient is going to dominate, in which case
$$
x(t) \sim a_1\sin\omega t
$$
is wrong, but not grossly wrong.
How you proceed from there depends on your personal taste.
Your text seems to be following a logic like


*

*the equation of motion is
$$
  -kx^2 = mx''
 $$

*substituting (1) on the left and (2) on the right,
$$
  -k \left(a\sin\omega t\right)^2 = -\omega^2 a\sin\omega t
$$

*solve for $T\propto 1/\omega$

*pretend not to notice that the period $T$ seems to depend on time, and only look at its dependence on the amplitude $a$.


The fourth step makes me uncomfortable, and I think it made you uncomfortable too, since you put it in the title of your question.
Qmechanic suggests the physicist's approach, using dimensional analysis.
The only free parameters in the motion are:
 the stiffness of the potential $k$, in $\rm J/m^3$;
the mass of the oscillator $m$ in kilograms;
 and the amplitude of the oscillation $a\propto a_1$ in meters.
There's only one way to combine these three physically meaningful parameters to obtain a time in seconds, and it gives $T\propto \sqrt{m/ak}$.
