Showing solution to this function by Euler-Lagrange I have the following function
$$\int_0^1\dot{x}(t)^2+x(t)^2+x(t)^4dt\to\text{min},\quad x\in W^{1,\infty}[0,1],\quad x(0)=-1,\quad x(1)=1$$
Without actually solving the problem, I'm just trying to show that the solution satisfies
$$\dot{x}(t)=\sqrt{x(t)^2(1+x(t)^2)+C},\quad\text{for some}\quad C>0$$
In the end, I feel my problem is unfortunately really a fundamental confusion related to primitivating $\ddot{x}(t)$, but I'll show my work and hopefully someone will be kind enough to clarify. I am just sort of running with the solution to some other problems that I have and applying analogous logic. So, I have been taught that the Euler-Lagrange equation is
$$\frac{\partial L}{\partial x}-\frac{d}{dt}\left(\frac{\partial L}{\partial\dot{x}}\right)=0$$
So, here we have $\frac{\partial L}{\partial x}=4x^3+2x$ and $\frac{\partial L}{\partial\dot{x}}=2\dot{x}$, resulting in
$$4x^3+2x-\frac{d}{dt}(2\dot{x})=0<=>4x^3+2x-2\ddot{x}=0<=>\ddot{x}=2x^3+x$$
...So I just wrote a bunch of thoughts I had on possible ways forward, but decided it was mostly incorrect clutter so hopefully someone can just come in with a clean, quick response. Thank you very much for any help.
Edit: Sorry, equation is with $\dot{x}(t)^2$, not $\dot{x}(t)$
 A: *

*OP's sought-for identity is just the Beltrami identity, aka. energy conservation 
$$ h(x,\dot{x})~:=~\dot{x}^2+V(x)~=~C, \qquad V(x)~:=~-x^2-x^4.$$  

*It can be viewed as a consequence of (i) the fact that the Lagrangian $$L(x,\dot{x})~:=~\dot{x}^2-V$$ has no explicit $t$-dependence, i.e. it possesses a symmetry; and (ii) Noether's theorem.
A: So I'm going to answer my own question, as I think I've got it now. Since we have some claim for $\dot{x}(t)$, we should be able to recover $\ddot{x}(t)$ by simply differentiating the right hand side with respect to $t$. In so doing, we find that
$$\frac{d}{dt}\left(\sqrt{x(t)^2(1+x(t)^2)+C}\right)=\frac{2x(t)^3\dot{x}(t)+2x(t)(1+x(t)^2)\dot{x}(t)}{2\sqrt{x(t)^2(1+x(t)^2)+C}}$$
Now, assuming that $\sqrt{x(t)^2(1+x(t)^2)+C}=\dot{x}(t)$ as claimed, we have
$$\frac{2x(t)^3\dot{x}(t)+2x(t)(1+x(t)^2)\dot{x}(t)}{2\dot{x}(t)}$$
$$=2x(t)^3+x(t)$$
And we have thus recovered $\ddot{x}(t)$
So, basically my error was that I wasn't realizing that that the full differentiation of the $x(t)$ terms with respect to $t$ is effectively subject to the chain rule, being functions that depend on $t$, and not just some variables $x$. Is that the right way to think about it?
$\textbf{Edit}$- I've gone back and continued to attempt to find the answer through primitivating $\ddot{x}$, since I would really like to be able to do this without being given the answer first and just confirming from there. I still have some confusion. So, basically it seems like my big problem previously was that I wasn't considering that the $x(t)$ terms need to be treated like composite functions. So, I can find the result thinking of the reverse chain rule (this may not even be correct, but hear me out) by
$$\int\ddot{x}(t)\frac{d}{dt}=\dot{x}(t)=\int 2x(t)^3+x(t)dt\int \frac{1}{\dot{x}(t)}2u^3du+\int\frac{1}{\dot{x}}udu=\frac{\frac{1}{2}u^4+\frac{1}{2}u^2+C}{\dot{x}}=\frac{x(t)^4+x(t)^2+C}{2\dot{x}}$$
Given that $C$ is arbitrary, we can collapse this with the $\frac{1}{2}$ to just get
$$\dot{x}(t)=\frac{x(t)^4+x(t)^2+C}{\dot{x}}<=>\dot{x}(t)^2=x(t)^4+x(t)^2+C<=>\dot{x}(t)=\sqrt{x(t)^4+x(t)^2+C}$$
$$=\sqrt{x(t)^2(1+x(t)^2)+C}$$
But this still slightly confuses me. Shouldn't we have $t$ variables somewhere in the primitive of the right hand side with respect to $t$? For example, I've worked through Euler-Lagrange functions in which $\ddot{x}$ ended up being set equal to some function that did have $t$ variables included, and we did treat the primitive of these variables as we would in any other circumstance. That is, I'm thinking of $\int 1dt=t+C$
