Extremal of $J[y] = \int_{0}^{1}e^x \sqrt{1 + y'^2} dx$ where $y \in C^2[0,1]$ This is a problem from a mathematical contest. We have to find the form of the extremal for the variational problem  $J[y] = \int_{0}^{1}e^x \sqrt{1 + y'^2} dx$ where $y \in C^2[0,1]$.
The answer given is : $y(x) = \sec ^{-1}\left( \frac{x}{c_1} \right) + c_2$ where $|c_1|<1$ and $c_2$ is arbitrary.
Now my problem is that using the Euler Lagrange equation I have:
$$\frac{d}{dx} \left( \frac{e^x y'}{ \sqrt{1 +y'^2 } } \right) =0 $$
$$ \implies e^{2x}y'^2 = c_1^2 + c_1^2y'^2 $$
$$ \implies y' = \pm \frac{c_1}{\sqrt{e^{2x}-c_1^2}} $$
but this does not give the required form so I must be making some mistakes. Can someone please guide me?
Any help is highly appreciated.
 A: *

*I think there must be some typing mistake, as my answer is $~y=\sec^{-1}\left(\dfrac{e^x}{c_1}\right)~+~c~,~~~|c_1|<1$

After your work,
$$y' = \pm \dfrac{c_1}{\sqrt{e^{2x}-c_1^2}}\implies y=\int \dfrac{c_1}{\sqrt{e^{2x}-c_1^2}}~dx~+~c~~~~\text{as} ~~y \in C^2[0,1]~.$$Putting $~z=e^{2x}-c_1^2\implies dz=2e^{2x}dx~,$
$$y= \dfrac {c_1}{2}\int \dfrac{dz}{\sqrt z~(z+c_1^2)}~+~c$$Again substituting, $~t=\frac{\sqrt z}{c_1}\implies dt=\frac{1}{2c_1\sqrt z}dz\implies dz=2tc_1^2~dt~,$
$$y= \dfrac {1}{2}\int \dfrac{2tc_1^2~dt}{t~(t^2c_1^2+c_1^2)}~+~c= \int \dfrac{dt}{(t^2+1)}~+~c=\tan^{-1}(t)~+~c=\tan^{-1}\left(\dfrac{\sqrt{e^{2x}-c_1^2}}{c_1}\right)~+~c$$where $~c~$ is integrating constant.
Now we know that $~\tan^2\theta+1=\sec^2\theta~.$
Let $~\theta=\tan^{-1}\left(\dfrac{\sqrt{e^{2x}-c_1^2}}{c_1}\right)\implies \tan^2\theta=\dfrac{e^{2x}-c_1^2}{c_1^2}=\sec^2\theta-1\implies \sec^2\theta=1+\dfrac{e^{2x}-c_1^2}{c_1^2}=\dfrac{e^{2x}}{c_1^2}\implies \sec\theta=\dfrac{e^x}{|c_1|}\implies \theta=\sec^{-1}\left(\dfrac{e^x}{|c_1|}\right)\implies \tan^{-1}\left(\dfrac{\sqrt{e^{2x}-c_1^2}}{c_1}\right)=\sec^{-1}\left(\dfrac{e^x}{c_1}\right)~,~~~|c_1|<1$
Hence the extremal is $~y=\sec^{-1}\left(\dfrac{e^x}{c_1}\right)~+~c~,~~~|c_1|<1$
