Starting with the differential equation
$$m\,\ddot x+\,F(x)=0\tag 1$$
where $~\,F(x)=k\,x+a\,x^3~$
you can see the numerical solution with the initial conditions
$~x(0)=x_0~,\dot x(0)=0~$ at this figure :

$~x(t)~$ is periodic motion but the period is depending on the amplitude of $~x(t)~$ which is $~x_0~$ , thus it is not simple harmonic motion
What's the period of this motion?
we want to obtain the time $~T~$ between the two blue points .
The period T
multiply equation (1) with $~\frac{dx}{dt}~$ and integrate you obtain the energy $~E=T+U~$
$$ E=\frac m2 \left(\frac{dx}{dt}\right)^2+U(x)\tag 2$$
where $~U(x)=\frac 12 k\,x^2+\frac 14 a\,x^4~$
at $~t=0~$ ,$~\frac{dx}{dt}=0~,x=x_0~$ thus
$$E_0= \frac 12 k\,x_0^2+\frac 14 a\,x_0^4$$
solve the equation $~E=E_0~$ for $~dt~$ you obtain
$$dt=\pm 2\,{\frac {m{\it dx}}{\sqrt {-2\,m \left( 2\,{x}^{2}k+a{x}^{4}-2\,{x_
{{0}}}^{2}k-a{x_{{0}}}^{4} \right) }}}
$$
from here the period $~T~$ is
$$T=\pm 4\,\int 2\,{\frac {m{\it dx}}{\sqrt {-2\,m \left( 2\,{x}^{2}k+a{x}^{4}-2\,{x_
{{0}}}^{2}k-a{x_{{0}}}^{4} \right) }}}
$$
the result is "elliptic integral "
$$T=\pm 4\,\sqrt {m}{\it EllipticF} \left( {\frac {x}{x_{{0}}}},{\frac {ix_{{0
}}\sqrt {a}}{\sqrt {2\,k+a{x_{{0}}}^{2}}}} \right) \sqrt {2}{\frac {1}
{\sqrt {2\,k+a{x_{{0}}}^{2}}}}\bigg|_{x=x0}^{x=0}
$$
with the data of the above figure $~|T|=3.179~$
$$\dot x\,m\,\ddot x+\dot x \,F(x)=0\\
\frac m2 \frac{d}{dt} \left(\dot{x}^2\right)=-\frac {dx}{dt}\,F(x)\\
\frac m2 {d} \left(\dot{x}^2\right)=-{dx}\,F(x)\\
\frac m2 \int {d} \left(\dot{x}^2\right)=-\int {dx}\,F(x)$$