If , show that the extremal is

I've done:

Then using Euler's equation we get:

So

and then I'm stuck from here, I can't see how to turn this is into trigonometric functions? I tried letting which didn't work...

Can anyone please help me?

Thanks in advance!