given : Consider $\displaystyle L(x,\dot x) = \dot x ^2 -x^2$

Show that the extremals are given by $\displaystyle x=\sqrt{\alpha}sin(t+\beta)$

Now i did a previous example as follows:Given $\displaystyle L(x,\dot x) = \dot x ^2$

$\displaystyle p=\frac{\partial L}{\partial \dot x} = 2\dot x $ Long story short, hamiltonian is

$\displaystyle H = \frac{p^2}{4}$ Which yields the Hamilton Jacobi $\displaystyle \frac{1}{4}( \frac{\partial S}{\partial x})^2 + \frac{\partial S}{\partial t}=0$

Now given the hint to use S of Form S=u(t) + v(x), hence $\displaystyle \frac{\partial S}{\partial t} = \frac{du}{dt} = -\frac{1}{4}( \frac{dv}{dx})^2 = K$

K a constant,i assume since no t in expression. From here, we let k= $\displaystyle -\alpha ^2$ and solve for t by direct integration, i.e $\displaystyle \frac{du}{dt} = - \alpha ^2$ and we do the same for $\displaystyle \frac{dv}{dx}$ and finally we get $\displaystyle S=-\alpha ^2 t+2\alpha x + \beta$ Where $\displaystyle \beta$ constant of integration. $\displaystyle \frac{\partial S}{\partial \alpha} $ then provides me with an expression in x for which i solve to get $\displaystyle x(t) = \alpha t + \frac{E}{2}$ Where E is the expression found from $\displaystyle \frac{\partial S}{\partial \alpha}$ ,which proves the extremal to be a straight line.

Now my problem is that for this example,$\displaystyle L(x,\dot x) = \dot x ^2 -x^2$

i get $\displaystyle p=\frac{\partial L}{\partial \dot x}\ \ so \ \dot x = \frac{p}{2} \ \ therefore \ \ H = -\frac{p^2}{4} + x^2 $

Which yields the Hamilton jacobi $\displaystyle -\frac{1}{4}(\frac{\partial S}{\partial x})^2 + x^2 +\frac{\partial S}{\partial t}}=0$

I have so little time, not enough to complete this question properly, but i believe i'm on the wrong track with this example, should x be here? I am asked to use the exact same hints and form for S as the first example but it just doesn't work out that way ! Because of x,I can no longer use total derivatives in place of partials for S! I get $\displaystyle S=-\alpha ^2t-\frac{x^3}{3} +4\alpha^2x + \beta$ Which doesn't solve the HJ! Any words of advice? Sorry for sloppy presentation of the question! I write in a week, have so much to learn!