18.5 problem 5

18.5.1 Solving as second order ode missing x ode
18.5.2 Maple step by step solution

Internal problem ID [2277]
Internal file name [OUTPUT/2277_Tuesday_February_27_2024_08_23_57_AM_82117291/index.tex]

Book: Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section: Exercise 35, page 157
Problem number: 5.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "second_order_ode_missing_x"

Maple gives the following as the ode type

[[_2nd_order, _missing_x], [_2nd_order, _reducible, _mu_x_y1]]

\[ \boxed {x^{\prime \prime }-\frac {k^{2}}{x^{2}}=0} \]

18.5.1 Solving as second order ode missing x ode

This is missing independent variable second order ode. Solved by reduction of order by using substitution which makes the dependent variable \(x\) an independent variable. Using \begin {align*} x' &= p(x) \end {align*}

Then \begin {align*} x'' &= \frac {dp}{dt}\\ &= \frac {dx}{dt} \frac {dp}{dx}\\ &= p \frac {dp}{dx} \end {align*}

Hence the ode becomes \begin {align*} p \left (x \right ) \left (\frac {d}{d x}p \left (x \right )\right ) x^{2} = k^{2} \end {align*}

Which is now solved as first order ode for \(p(x)\). In canonical form the ODE is \begin {align*} p' &= F(x,p)\\ &= f( x) g(p)\\ &= \frac {k^{2}}{p \,x^{2}} \end {align*}

Where \(f(x)=\frac {k^{2}}{x^{2}}\) and \(g(p)=\frac {1}{p}\). Integrating both sides gives \begin{align*} \frac {1}{\frac {1}{p}} \,dp &= \frac {k^{2}}{x^{2}} \,d x \\ \int { \frac {1}{\frac {1}{p}} \,dp} &= \int {\frac {k^{2}}{x^{2}} \,d x} \\ \frac {p^{2}}{2}&=-\frac {k^{2}}{x}+c_{1} \\ \end{align*} The solution is \[ \frac {p \left (x \right )^{2}}{2}+\frac {k^{2}}{x}-c_{1} = 0 \] For solution (1) found earlier, since \(p=x^{\prime }\) then we now have a new first order ode to solve which is \begin {align*} \frac {{x^{\prime }}^{2}}{2}+\frac {k^{2}}{x}-c_{1} = 0 \end {align*}

Solving the given ode for \(x^{\prime }\) results in \(2\) differential equations to solve. Each one of these will generate a solution. The equations generated are \begin {align*} x^{\prime }&=\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \tag {1} \\ x^{\prime }&=-\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \tag {2} \end {align*}

Now each one of the above ODE is solved.

Solving equation (1)

Integrating both sides gives \begin{align*} \int \frac {x \sqrt {2}}{2 \sqrt {x \left (c_{1} x -k^{2}\right )}}d x &= \int d t \\ \frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}}&=t +c_{2} \\ \end{align*} Solving equation (2)

Integrating both sides gives \begin{align*} \int -\frac {x \sqrt {2}}{2 \sqrt {x \left (c_{1} x -k^{2}\right )}}d x &= \int d t \\ -\frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}}&=c_{3} +t \\ \end{align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} \frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}} &= t +c_{2} \\ \tag{2} -\frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}} &= c_{3} +t \\ \end{align*}

Verification of solutions

\[ \frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}} = t +c_{2} \] Verified OK.

\[ -\frac {\sqrt {2}\, \left (\operatorname {arctanh}\left (\frac {\sqrt {-x \left (-c_{1} x+k^{2}\right )}}{x \sqrt {c_{1}}}\right ) k^{2}+\sqrt {-x \left (-c_{1} x+k^{2}\right )}\, \sqrt {c_{1}}\right )}{2 c_{1}^{\frac {3}{2}}} = c_{3} +t \] Verified OK.

18.5.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x^{\prime \prime } x^{2}=k^{2} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & x^{\prime \prime } \\ \bullet & {} & \textrm {Define new dependent variable}\hspace {3pt} u \\ {} & {} & u \left (t \right )=x^{\prime } \\ \bullet & {} & \textrm {Compute}\hspace {3pt} x^{\prime \prime } \\ {} & {} & u^{\prime }\left (t \right )=x^{\prime \prime } \\ \bullet & {} & \textrm {Use chain rule on the lhs}\hspace {3pt} \\ {} & {} & x^{\prime } \left (\frac {d}{d x}u \left (x \right )\right )=x^{\prime \prime } \\ \bullet & {} & \textrm {Substitute in the definition of}\hspace {3pt} u \\ {} & {} & u \left (x \right ) \left (\frac {d}{d x}u \left (x \right )\right )=x^{\prime \prime } \\ \bullet & {} & \textrm {Make substitutions}\hspace {3pt} x^{\prime }=u \left (x \right ),x^{\prime \prime }=u \left (x \right ) \left (\frac {d}{d x}u \left (x \right )\right )\hspace {3pt}\textrm {to reduce order of ODE}\hspace {3pt} \\ {} & {} & u \left (x \right ) \left (\frac {d}{d x}u \left (x \right )\right ) x^{2}=k^{2} \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}u \left (x \right )=\frac {k^{2}}{u \left (x \right ) x^{2}} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & u \left (x \right ) \left (\frac {d}{d x}u \left (x \right )\right )=\frac {k^{2}}{x^{2}} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int u \left (x \right ) \left (\frac {d}{d x}u \left (x \right )\right )d x =\int \frac {k^{2}}{x^{2}}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {u \left (x \right )^{2}}{2}=-\frac {k^{2}}{x}+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} u \left (x \right ) \\ {} & {} & \left \{u \left (x \right )=\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x -k^{2}\right )}}{x}, u \left (x \right )=-\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x -k^{2}\right )}}{x}\right \} \\ \bullet & {} & \textrm {Solve 1st ODE for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x -k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Revert to original variables with substitution}\hspace {3pt} u \left (x \right )=x^{\prime },x =x \\ {} & {} & x^{\prime }=\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & x^{\prime }=\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {x^{\prime } x}{\sqrt {x \left (c_{1} x-k^{2}\right )}}=\sqrt {2} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \frac {x^{\prime } x}{\sqrt {x \left (c_{1} x-k^{2}\right )}}d t =\int \sqrt {2}d t +c_{2} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {\sqrt {x^{2} c_{1} -k^{2} x}}{c_{1}}+\frac {k^{2} \ln \left (\frac {-\frac {k^{2}}{2}+c_{1} x}{\sqrt {c_{1}}}+\sqrt {x^{2} c_{1} -k^{2} x}\right )}{2 c_{1}^{\frac {3}{2}}}=\sqrt {2}\, t +c_{2} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} x \\ {} & {} & \left \{\frac {4 c_{1} \left ({\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t -64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t +16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}+64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}+128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}-k^{8}+8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}-16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )}\right )^{2}+4 \sqrt {c_{1}}\, k^{2} {\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t -64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t +16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}+64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}+128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}-k^{8}+8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}-16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )}+k^{4}}{8 \,{\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t -64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t +16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}+64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}+128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}-k^{8}+8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}-16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )} c_{1}^{\frac {3}{2}}}\right \} \\ \bullet & {} & \textrm {Solve 2nd ODE for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=-\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x -k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Revert to original variables with substitution}\hspace {3pt} u \left (x \right )=x^{\prime },x =x \\ {} & {} & x^{\prime }=-\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & x^{\prime }=-\frac {\sqrt {2}\, \sqrt {x \left (c_{1} x-k^{2}\right )}}{x} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {x^{\prime } x}{\sqrt {x \left (c_{1} x-k^{2}\right )}}=-\sqrt {2} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \frac {x^{\prime } x}{\sqrt {x \left (c_{1} x-k^{2}\right )}}d t =\int -\sqrt {2}d t +c_{2} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {\sqrt {x^{2} c_{1} -k^{2} x}}{c_{1}}+\frac {k^{2} \ln \left (\frac {-\frac {k^{2}}{2}+c_{1} x}{\sqrt {c_{1}}}+\sqrt {x^{2} c_{1} -k^{2} x}\right )}{2 c_{1}^{\frac {3}{2}}}=-\sqrt {2}\, t +c_{2} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} x \\ {} & {} & \left \{\frac {4 c_{1} \left ({\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t +64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t -16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}-64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}-128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}+k^{8}-8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}+16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )}\right )^{2}+4 \sqrt {c_{1}}\, k^{2} {\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t +64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t -16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}-64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}-128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}+k^{8}-8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}+16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )}+k^{4}}{8 \,{\mathrm e}^{\mathit {RootOf}\left (-64 \sqrt {2}\, c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} \textit {\_Z} \,k^{2} t +64 c_{1}^{\frac {5}{2}} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} \textit {\_Z} \,k^{2}+128 \sqrt {2}\, c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2} t -16 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1} \textit {\_Z}^{2} k^{4}-64 c_{1}^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{2}^{2}-128 \left ({\mathrm e}^{\textit {\_Z}}\right )^{2} c_{1}^{4} t^{2}+k^{8}-8 c_{1} k^{4} \left ({\mathrm e}^{\textit {\_Z}}\right )^{2}+16 c_{1}^{2} \left ({\mathrm e}^{\textit {\_Z}}\right )^{4}\right )} c_{1}^{\frac {3}{2}}}\right \} \end {array} \]

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying 2nd order Liouville 
trying 2nd order WeierstrassP 
trying 2nd order JacobiSN 
differential order: 2; trying a linearization to 3rd order 
trying 2nd order ODE linearizable_by_differentiation 
trying 2nd order, 2 integrating factors of the form mu(x,y) 
trying differential order: 2; missing variables 
`, `-> Computing symmetries using: way = 3 
-> Calling odsolve with the ODE`, (diff(_b(_a), _a))*_b(_a)-k^2/_a^2 = 0, _b(_a), HINT = [[_a, -(1/2)*_b]]`   *** Sublevel 2 *** 
   symmetry methods on request 
`, `1st order, trying reduction of order with given symmetries:`[_a, -1/2*_b]
 

Solution by Maple

Time used: 0.031 (sec). Leaf size: 385

dsolve(diff(x(t),t$2)=k^2/x(t)^2,x(t), singsol=all)
 

\begin{align*} x \left (t \right ) &= \frac {c_{1} \left (c_{1}^{2} k^{4}+2 k^{2} c_{1} {\mathrm e}^{\operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}-2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} -2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}+{\mathrm e}^{2 \operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}-2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} -2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}\right ) {\mathrm e}^{-\operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}-2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} -2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}}{2} \\ x \left (t \right ) &= \frac {c_{1} \left (c_{1}^{2} k^{4}+2 k^{2} c_{1} {\mathrm e}^{\operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}+2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} +2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}+{\mathrm e}^{2 \operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}+2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} +2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}\right ) {\mathrm e}^{-\operatorname {RootOf}\left (\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) c_{1}^{4} k^{4}-2 \textit {\_Z} \,c_{1}^{3} k^{2} {\mathrm e}^{\textit {\_Z}}-\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{2 \textit {\_Z}} c_{1}^{2}+2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} c_{2} +2 \,\operatorname {csgn}\left (\frac {1}{c_{1}}\right ) {\mathrm e}^{\textit {\_Z}} t \right )}}{2} \\ \end{align*}

Solution by Mathematica

Time used: 0.188 (sec). Leaf size: 71

DSolve[x''[t]==k^2/x[t]^2,x[t],t,IncludeSingularSolutions -> True]
 

\[ \text {Solve}\left [\left (\frac {2 k^2 \text {arctanh}\left (\frac {\sqrt {-\frac {2 k^2}{x(t)}+c_1}}{\sqrt {c_1}}\right )}{c_1{}^{3/2}}+\frac {x(t) \sqrt {-\frac {2 k^2}{x(t)}+c_1}}{c_1}\right ){}^2=(t+c_2){}^2,x(t)\right ] \]