4.9.1.1.4 Example 4 \(2y^{\prime \prime }-e^{y}=0,y\left ( 0\right ) =0,y^{\prime }\left ( 0\right ) =1\)

\begin{equation} 2y^{\prime \prime }-e^{y}=0 \tag {1}\end{equation}
With IC
\begin{align*} y\left ( 0\right ) & =0\\ y^{\prime }\left ( 0\right ) & =1 \end{align*}

Let \(p=y^{\prime }\) then \(y^{\prime \prime }=p\frac {dp}{dy}\). Hence the ode becomes

\begin{align} 2p\frac {dp}{dy}-e^{y} & =0\nonumber \\ 2\frac {dp}{dy}p & =e^{y} \tag {2}\end{align}

This is separable.

\begin{align} 2\int pdp & =\int e^{y}dy\nonumber \\ p^{2} & =e^{y}+c_{1} \tag {3}\end{align}

Before solving this, we should apply IC now as it simplifies the solution greatly. This assumes both \(y,y^{\prime }\) are are given at same point \(x_{0}\). Which is the case here. If only one IC is given (such as \(y\left ( 0\right ) \) or \(y^{\prime }\left ( 0\right ) \) but not both, then we can not apply IC now and have to do it at the end).

We are given that \(y^{\prime }\left ( 0\right ) =p=1,y\left ( 0\right ) =0\), hence the above reduces to

\begin{align*} 1 & =e^{0}+c_{1}\\ c_{1} & =0 \end{align*}

Hence (3) now becomes

\[ p^{2}=e^{y}\]
but \(p=y^{\prime }\) hence
\begin{align*} \left ( y^{\prime }\right ) ^{2} & =e^{y}\\ y^{\prime } & =\pm \sqrt {e^{y}}\end{align*}

This is quadrature. For the positive solution

\begin{align} \frac {dy}{\sqrt {e^{y}}} & =dx\tag {4}\\ \frac {2}{\sqrt {e^{y}}} & =-x+c_{2}\end{align}

For \(y\left ( 0\right ) =0\) we obtain

\[ 2=c_{2}\]
Hence (4) becomes
\begin{align*} \frac {2}{\sqrt {e^{y}}} & =-x+2\\ \sqrt {e^{y}} & =\frac {2}{2-x}\\ e^{y} & =\left ( \frac {2}{2-x}\right ) ^{2}\\ y_{1} & =2\ln \left ( \frac {2}{2-x}\right ) \end{align*}

For the negative solution

\[ y^{\prime }=-\sqrt {e^{y}}\]
Integrating
\begin{equation} \frac {2}{\sqrt {e^{y}}}=x+c_{2} \tag {5}\end{equation}
At \(y\left ( 0\right ) =0\)
\[ 2=c_{2}\]
Hence (5) becomes
\begin{align*} \frac {2}{\sqrt {e^{y}}} & =x+2\\ \sqrt {e^{y}} & =\frac {2}{x+2}\\ e^{y} & =\left ( \frac {2}{x+2}\right ) ^{2}\\ y_{2} & =2\ln \left ( \frac {2}{x+2}\right ) \end{align*}

However, this solution do not satisfy \(y^{\prime }\left ( 0\right ) =1\) so it is discarded. Hence the solution is only

\[ y_{1}=2\ln \left ( \frac {2}{2-x}\right ) \]