Checking my work on a conservation of energy problem

Homework Statement

Given: [itex]\frac{1}{2}m (\dot x)^2 + mg x = E[/itex]

Gravitational force is mg.

We need to show that by solving this DE that we can confirm that the conservation of energy correctly describes one-dimensional motion (the motion in a uniform field). That is, that the same motion is obtained as predicted by Newton' equation of motion. I had this up as a thread before -- (thanks to tiny-tim!) but I discovered that there might have been some bad errors in my original set-up. So I wanted to see if I corrected those.

The Attempt at a Solution

My attempt was as follows:

[itex]\frac{1}{2}m\dot x + mg x = E[/itex] so by moving things around a bit I can reduce this to

You have complexified this too much!
Take the energy equation, which holds for ALL times, and differentiate it.
That is allowed, because it holds for ALL t's.
We then get:
[tex]m\ddot{x}\dot{x}+mg\dot{x}=0[/tex]
That is:
[tex]\dot{x}(m\ddot{x}+mg)=0[/tex]
meaning that Newton's 2.law of motion is contained as one of two possible solutions.
If the velocity is zero, then position is also unchanging, and the energy equation holds trivially. The other solution, Newton's 2.law, is the one governing a system in motion, and consistent with the energy law of conservation.