2.6.1 Problem 1

Solved as second order linear constant coeff ode
Solved as second order can be made integrable
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18494]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 33. Problems at page 91
Problem number : 1
Date solved : Monday, March 31, 2025 at 05:37:36 PM
CAS classification : [[_2nd_order, _missing_x]]

Solved as second order linear constant coeff ode

Time used: 0.104 (sec)

Solve

\begin{align*} \theta ^{\prime \prime }&=-p^{2} \theta \end{align*}

This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

\[ A \theta ''(t) + B \theta '(t) + C \theta (t) = 0 \]

Where in the above \(A=1, B=0, C=p^{2}\). Let the solution be \(\theta =e^{\lambda t}\). Substituting this into the ODE gives

\[ \lambda ^{2} {\mathrm e}^{t \lambda }+p^{2} {\mathrm e}^{t \lambda } = 0 \tag {1} \]

Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda t}\) gives

\[ \lambda ^{2}+p^{2} = 0 \tag {2} \]

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

\[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]

Substituting \(A=1, B=0, C=p^{2}\) into the above gives

\begin{align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (p^{2}\right )}\\ &= \pm \sqrt {-p^{2}} \end{align*}

Hence

\begin{align*} \lambda _1 &= + \sqrt {-p^{2}}\\ \lambda _2 &= - \sqrt {-p^{2}} \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= i p \\ \lambda _2 &= -i p \\ \end{align*}

Since roots are complex conjugate of each others, then let the roots be

\[ \lambda _{1,2} = \alpha \pm i \beta \]

Where \(\alpha =0\) and \(\beta =p\). Therefore the final solution, when using Euler relation, can be written as

\[ \theta = e^{\alpha t} \left ( c_1 \cos (\beta t) + c_2 \sin (\beta t) \right ) \]

Which becomes

\[ \theta = e^{0}\left (c_1 \cos \left (p t \right )+c_2 \sin \left (p t \right )\right ) \]

Or

\[ \theta = c_1 \cos \left (p t \right )+c_2 \sin \left (p t \right ) \]

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} \theta &= c_1 \cos \left (p t \right )+c_2 \sin \left (p t \right ) \\ \end{align*}

Solved as second order can be made integrable

Time used: 0.992 (sec)

Solve

\begin{align*} \theta ^{\prime \prime }&=-p^{2} \theta \end{align*}

Multiplying the ode by \(\theta ^{\prime }\) gives

\[ \theta ^{\prime } \theta ^{\prime \prime }+\theta ^{\prime } p^{2} \theta = 0 \]

Integrating the above w.r.t \(t\) gives

\begin{align*} \int \left (\theta ^{\prime } \theta ^{\prime \prime }+\theta ^{\prime } p^{2} \theta \right )d t &= 0 \\ \frac {{\theta ^{\prime }}^{2}}{2}+\frac {p^{2} \theta ^{2}}{2} &= c_1 \end{align*}

Which is now solved for \(\theta \). Let \(p=\theta ^{\prime }\) the ode becomes

\begin{align*} \frac {p^{2}}{2}+\frac {p^{2} \theta ^{2}}{2} = c_1 \end{align*}

Solving for \(\theta \) from the above results in

\begin{align*} \tag{1} \theta &= \frac {\sqrt {-p^{2}+2 c_1}}{p} \\ \tag{2} \theta &= -\frac {\sqrt {-p^{2}+2 c_1}}{p} \\ \end{align*}

This has the form

\begin{align*} \theta =t f(p)+g(p)\tag {*} \end{align*}

Where \(f,g\) are functions of \(p=\theta '(t)\). Each of the above ode’s is dAlembert ode which is now solved.

Solving ode 1A

Taking derivative of (*) w.r.t. \(t\) gives

\begin{align*} p &= f+(t f'+g') \frac {dp}{dt}\\ p-f &= (t f'+g') \frac {dp}{dt}\tag {2} \end{align*}

Comparing the form \(\theta =t f + g\) to (1A) shows that

\begin{align*} f &= 0\\ g &= \frac {\sqrt {-p^{2}+2 c_1}}{p} \end{align*}

Hence (2) becomes

\begin{equation} \tag{2A} p = -\frac {p p^{\prime }\left (t \right )}{\sqrt {-p^{2}+2 c_1}\, p} \end{equation}

The singular solution is found by setting \(\frac {dp}{dt}=0\) in the above which gives

\begin{align*} p = 0 \end{align*}

Solving the above for \(p\) results in

\begin{align*} p_{1} &=0 \end{align*}

Substituting these in (1A) and keeping singular solution that verifies the ode gives

\begin{align*} \theta = \frac {\sqrt {2}\, \sqrt {c_1}}{p} \end{align*}

The general solution is found when \( \frac { \mathop {\mathrm {d}p}}{\mathop {\mathrm {d}t}}\neq 0\). From eq. (2A). This results in

\begin{equation} \tag{3} p^{\prime }\left (t \right ) = -\sqrt {-p \left (t \right )^{2}+2 c_1}\, p \end{equation}

This ODE is now solved for \(p \left (t \right )\). No inversion is needed.

Integrating gives

\begin{align*} \int -\frac {1}{\sqrt {-p^{2}+2 c_1}\, p}d p &= dt\\ -\frac {\arctan \left (\frac {p}{\sqrt {-p^{2}+2 c_1}}\right )}{p}&= t +c_2 \end{align*}

Singular solutions are found by solving

\begin{align*} -\sqrt {-p^{2}+2 c_1}\, p&= 0 \end{align*}

for \(p \left (t \right )\). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

\begin{align*} p \left (t \right ) = \sqrt {2}\, \sqrt {c_1}\\ p \left (t \right ) = -\sqrt {2}\, \sqrt {c_1} \end{align*}

Substituing the above solution for \(p\) in (2A) gives

\begin{align*} \theta &= \frac {\sqrt {-\frac {2 \tan \left (c_2 p +p t \right )^{2} c_1}{\tan \left (c_2 p +p t \right )^{2}+1}+2 c_1}}{p} \\ \theta &= 0 \\ \theta &= 0 \\ \end{align*}

Solving ode 2A

Taking derivative of (*) w.r.t. \(t\) gives

\begin{align*} p &= f+(t f'+g') \frac {dp}{dt}\\ p-f &= (t f'+g') \frac {dp}{dt}\tag {2} \end{align*}

Comparing the form \(\theta =t f + g\) to (1A) shows that

\begin{align*} f &= 0\\ g &= -\frac {\sqrt {-p^{2}+2 c_1}}{p} \end{align*}

Hence (2) becomes

\begin{equation} \tag{2A} p = \frac {p p^{\prime }\left (t \right )}{\sqrt {-p^{2}+2 c_1}\, p} \end{equation}

The singular solution is found by setting \(\frac {dp}{dt}=0\) in the above which gives

\begin{align*} p = 0 \end{align*}

Solving the above for \(p\) results in

\begin{align*} p_{1} &=0 \end{align*}

Substituting these in (1A) and keeping singular solution that verifies the ode gives

\begin{align*} \theta = -\frac {\sqrt {2}\, \sqrt {c_1}}{p} \end{align*}

The general solution is found when \( \frac { \mathop {\mathrm {d}p}}{\mathop {\mathrm {d}t}}\neq 0\). From eq. (2A). This results in

\begin{equation} \tag{3} p^{\prime }\left (t \right ) = \sqrt {-p \left (t \right )^{2}+2 c_1}\, p \end{equation}

This ODE is now solved for \(p \left (t \right )\). No inversion is needed.

Integrating gives

\begin{align*} \int \frac {1}{\sqrt {-p^{2}+2 c_1}\, p}d p &= dt\\ \frac {\arctan \left (\frac {p}{\sqrt {-p^{2}+2 c_1}}\right )}{p}&= t +c_3 \end{align*}

Singular solutions are found by solving

\begin{align*} \sqrt {-p^{2}+2 c_1}\, p&= 0 \end{align*}

for \(p \left (t \right )\). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

\begin{align*} p \left (t \right ) = \sqrt {2}\, \sqrt {c_1}\\ p \left (t \right ) = -\sqrt {2}\, \sqrt {c_1} \end{align*}

Substituing the above solution for \(p\) in (2A) gives

\begin{align*} \theta &= -\frac {\sqrt {-\frac {2 \tan \left (c_3 p +p t \right )^{2} c_1}{\tan \left (c_3 p +p t \right )^{2}+1}+2 c_1}}{p} \\ \theta &= 0 \\ \theta &= 0 \\ \end{align*}

Will add steps showing solving for IC soon.

The solution

\[ \theta = \frac {\sqrt {2}\, \sqrt {c_1}}{p} \]

was found not to satisfy the ode or the IC. Hence it is removed. The solution

\[ \theta = -\frac {\sqrt {2}\, \sqrt {c_1}}{p} \]

was found not to satisfy the ode or the IC. Hence it is removed.

Summary of solutions found

\begin{align*} \theta &= 0 \\ \theta &= \frac {\sqrt {-\frac {2 \tan \left (c_2 p +p t \right )^{2} c_1}{\tan \left (c_2 p +p t \right )^{2}+1}+2 c_1}}{p} \\ \theta &= -\frac {\sqrt {-\frac {2 \tan \left (c_3 p +p t \right )^{2} c_1}{\tan \left (c_3 p +p t \right )^{2}+1}+2 c_1}}{p} \\ \end{align*}

Solved as second order ode using Kovacic algorithm

Time used: 0.088 (sec)

Solve

\begin{align*} \theta ^{\prime \prime }&=-p^{2} \theta \end{align*}

Writing the ode as

\begin{align*} \theta ^{\prime \prime }+p^{2} \theta &= 0 \tag {1} \\ A \theta ^{\prime \prime } + B \theta ^{\prime } + C \theta &= 0 \tag {2} \end{align*}

Comparing (1) and (2) shows that

\begin{align*} A &= 1 \\ B &= 0\tag {3} \\ C &= p^{2} \end{align*}

Applying the Liouville transformation on the dependent variable gives

\begin{align*} z(t) &= \theta e^{\int \frac {B}{2 A} \,dt} \end{align*}

Then (2) becomes

\begin{align*} z''(t) = r z(t)\tag {4} \end{align*}

Where \(r\) is given by

\begin{align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end{align*}

Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives

\begin{align*} r &= \frac {-p^{2}}{1}\tag {6} \end{align*}

Comparing the above to (5) shows that

\begin{align*} s &= -p^{2}\\ t &= 1 \end{align*}

Therefore eq. (4) becomes

\begin{align*} z''(t) &= \left ( -p^{2}\right ) z(t)\tag {7} \end{align*}

Equation (7) is now solved. After finding \(z(t)\) then \(\theta \) is found using the inverse transformation

\begin{align*} \theta &= z \left (t \right ) e^{-\int \frac {B}{2 A} \,dt} \end{align*}

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table summarizes these cases.

Case

Allowed pole order for \(r\)

Allowed value for \(\mathcal {O}(\infty )\)

1

\(\left \{ 0,1,2,4,6,8,\cdots \right \} \)

\(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \)

2

Need to have at least one pole that is either order \(2\) or odd order greater than \(2\). Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\).

no condition

3

\(\left \{ 1,2\right \} \)

\(\left \{ 2,3,4,5,6,7,\cdots \right \} \)

Table 2.10: Necessary conditions for each Kovacic case

The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore

\begin{align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 0 - 0 \\ &= 0 \end{align*}

There are no poles in \(r\). Therefore the set of poles \(\Gamma \) is empty. Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is \(0\) then the necessary conditions for case one are met. Therefore

\begin{align*} L &= [1] \end{align*}

Since \(r = -p^{2}\) is not a function of \(t\), then there is no need run Kovacic algorithm to obtain a solution for transformed ode \(z''=r z\) as one solution is

\[ z_1(t) = {\mathrm e}^{\sqrt {-p^{2}}\, t} \]

Using the above, the solution for the original ode can now be found. The first solution to the original ode in \(\theta \) is found from

\[ \theta _1 = z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dt} \]

Since \(B=0\) then the above reduces to

\begin{align*} \theta _1 &= z_1 \\ &= {\mathrm e}^{\sqrt {-p^{2}}\, t} \\ \end{align*}

Which simplifies to

\[ \theta _1 = {\mathrm e}^{\sqrt {-p^{2}}\, t} \]

The second solution \(\theta _2\) to the original ode is found using reduction of order

\[ \theta _2 = \theta _1 \int \frac { e^{\int -\frac {B}{A} \,dt}}{\theta _1^2} \,dt \]

Since \(B=0\) then the above becomes

\begin{align*} \theta _2 &= \theta _1 \int \frac {1}{\theta _1^2} \,dt \\ &= {\mathrm e}^{\sqrt {-p^{2}}\, t}\int \frac {1}{{\mathrm e}^{2 \sqrt {-p^{2}}\, t}} \,dt \\ &= {\mathrm e}^{\sqrt {-p^{2}}\, t}\left (\frac {\sqrt {-p^{2}}\, {\mathrm e}^{-2 \sqrt {-p^{2}}\, t}}{2 p^{2}}\right ) \\ \end{align*}

Therefore the solution is

\begin{align*} \theta &= c_1 \theta _1 + c_2 \theta _2 \\ &= c_1 \left ({\mathrm e}^{\sqrt {-p^{2}}\, t}\right ) + c_2 \left ({\mathrm e}^{\sqrt {-p^{2}}\, t}\left (\frac {\sqrt {-p^{2}}\, {\mathrm e}^{-2 \sqrt {-p^{2}}\, t}}{2 p^{2}}\right )\right ) \\ \end{align*}

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} \theta &= c_1 \,{\mathrm e}^{\sqrt {-p^{2}}\, t}+\frac {c_2 \,{\mathrm e}^{-\sqrt {-p^{2}}\, t} \sqrt {-p^{2}}}{2 p^{2}} \\ \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 17
ode:=diff(diff(theta(t),t),t) = -p^2*theta(t); 
dsolve(ode,theta(t), singsol=all);
 
\[ \theta = c_1 \sin \left (p t \right )+c_2 \cos \left (p t \right ) \]

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
<- constant coefficients successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d t}\frac {d}{d t}\theta \left (t \right )=-p^{2} \theta \left (t \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d}{d t}\frac {d}{d t}\theta \left (t \right ) \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} \theta \left (t \right )\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linear}\hspace {3pt} \\ {} & {} & \frac {d}{d t}\frac {d}{d t}\theta \left (t \right )+p^{2} \theta \left (t \right )=0 \\ \bullet & {} & \textrm {Characteristic polynomial of ODE}\hspace {3pt} \\ {} & {} & p^{2}+r^{2}=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {0\pm \left (\sqrt {-4 p^{2}}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (\sqrt {-p^{2}}, -\sqrt {-p^{2}}\right ) \\ \bullet & {} & \textrm {1st solution of the ODE}\hspace {3pt} \\ {} & {} & \theta _{1}\left (t \right )={\mathrm e}^{\sqrt {-p^{2}}\, t} \\ \bullet & {} & \textrm {2nd solution of the ODE}\hspace {3pt} \\ {} & {} & \theta _{2}\left (t \right )={\mathrm e}^{-\sqrt {-p^{2}}\, t} \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & \theta \left (t \right )=\mathit {C1} \theta _{1}\left (t \right )+\mathit {C2} \theta _{2}\left (t \right ) \\ \bullet & {} & \textrm {Substitute in solutions}\hspace {3pt} \\ {} & {} & \theta \left (t \right )=\mathit {C1} \,{\mathrm e}^{\sqrt {-p^{2}}\, t}+\mathit {C2} \,{\mathrm e}^{-\sqrt {-p^{2}}\, t} \end {array} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 20
ode=D[theta[t],{t,2}]==-p^2*theta[t]; 
ic={}; 
DSolve[{ode,ic},theta[t],t,IncludeSingularSolutions->True]
 
\[ \theta (t)\to c_1 \cos (p t)+c_2 \sin (p t) \]
Sympy. Time used: 0.093 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
p = symbols("p") 
theta = Function("theta") 
ode = Eq(p**2*theta(t) + Derivative(theta(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=theta(t),ics=ics)
 
\[ \theta {\left (t \right )} = C_{1} e^{- i p t} + C_{2} e^{i p t} \]