2.7.2 Problem 2

2.7.2.1 second order linear constant coeff
2.7.2.2 second order ode can be made integrable
2.7.2.3 second order kovacic
2.7.2.4 SSolved using second order ode arccos transformation
2.7.2.5 Maple
2.7.2.6 Mathematica
2.7.2.7 Sympy

Internal problem ID [19751]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter VII. Linear equations of order higher than the first. section 56. Problems at page 163
Problem number : 2
Date solved : Thursday, December 11, 2025 at 01:54:06 PM
CAS classification : [[_2nd_order, _missing_x]]

2.7.2.1 second order linear constant coeff

0.056 (sec)

\begin{align*} y^{\prime \prime }+y&=0 \\ \end{align*}
Entering second order linear constant coefficient ode solver

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

\[ A y''(x) + B y'(x) + C y(x) = 0 \]
Where in the above \(A=1, B=0, C=1\). Let the solution be \(y=e^{\lambda x}\). Substituting this into the ODE gives
\[ \lambda ^{2} {\mathrm e}^{x \lambda }+{\mathrm e}^{x \lambda } = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives
\[ \lambda ^{2}+1 = 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=1\) 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 (1\right )}\\ &= \pm i \end{align*}

Hence

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

Which simplifies to

\begin{align*} \lambda _1 &= i \\ \lambda _2 &= -i \\ \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 =1\). Therefore the final solution, when using Euler relation, can be written as
\[ y = e^{\alpha x} \left ( c_1 \cos (\beta x) + c_2 \sin (\beta x) \right ) \]
Which becomes
\[ y = e^{0}\left (\cos \left (x \right ) c_1+c_2 \sin \left (x \right )\right ) \]
Or
\[ y = \cos \left (x \right ) c_1+c_2 \sin \left (x \right ) \]

Summary of solutions found

\begin{align*} y &= \cos \left (x \right ) c_1 +c_2 \sin \left (x \right ) \\ \end{align*}
Figure 2.111: Slope field \(y^{\prime \prime }+y = 0\)
2.7.2.2 second order ode can be made integrable

0.881 (sec)

\begin{align*} y^{\prime \prime }+y&=0 \\ \end{align*}
Entering second order ode can be made integrable solverMultiplying the ode by \(y^{\prime }\) gives
\[ y^{\prime } y^{\prime \prime }+y^{\prime } y = 0 \]
Integrating the above w.r.t \(x\) gives
\begin{align*} \int \left (y^{\prime } y^{\prime \prime }+y^{\prime } y\right )d x &= 0 \\ \frac {{y^{\prime }}^{2}}{2}+\frac {y^{2}}{2} &= c_1 \end{align*}

Which is now solved for \(y\). Entering first order ode dAlembert solverLet \(p=y^{\prime }\) the ode becomes

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

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

\begin{align*} \tag{1} y &= \sqrt {-p^{2}+2 c_1} \\ \tag{2} y &= -\sqrt {-p^{2}+2 c_1} \\ \end{align*}
This has the form
\begin{align*} y=x f(p)+g(p)\tag {*} \end{align*}

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

Solving ode 1A

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

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

Comparing the form \(y=x f + g\) to (1A) shows that

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

Hence (2) becomes

\begin{equation} \tag{2A} p = -\frac {p p^{\prime }\left (x \right )}{\sqrt {-p^{2}+2 c_1}} \end{equation}
The singular solution is found by setting \(\frac {dp}{dx}=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*} y = \sqrt {2}\, \sqrt {c_1} \end{align*}

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

\begin{equation} \tag{3} p^{\prime }\left (x \right ) = -\sqrt {-p \left (x \right )^{2}+2 c_1} \end{equation}
This ODE is now solved for \(p \left (x \right )\). No inversion is needed.

Integrating gives

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

Singular solutions are found by solving

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

for \(p \left (x \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 (x \right ) = \sqrt {2}\, \sqrt {c_1}\\ p \left (x \right ) = -\sqrt {2}\, \sqrt {c_1} \end{align*}

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

\begin{align*} y &= \sqrt {-\frac {2 \tan \left (x +c_2 \right )^{2} c_1}{\tan \left (x +c_2 \right )^{2}+1}+2 c_1} \\ y &= 0 \\ y &= 0 \\ \end{align*}
Solving ode 2A

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

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

Comparing the form \(y=x f + g\) to (1A) shows that

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

Hence (2) becomes

\begin{equation} \tag{2A} p = \frac {p p^{\prime }\left (x \right )}{\sqrt {-p^{2}+2 c_1}} \end{equation}
The singular solution is found by setting \(\frac {dp}{dx}=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*} y = -\sqrt {2}\, \sqrt {c_1} \end{align*}

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

\begin{equation} \tag{3} p^{\prime }\left (x \right ) = \sqrt {-p \left (x \right )^{2}+2 c_1} \end{equation}
This ODE is now solved for \(p \left (x \right )\). No inversion is needed.

Integrating gives

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

Singular solutions are found by solving

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

for \(p \left (x \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 (x \right ) = \sqrt {2}\, \sqrt {c_1}\\ p \left (x \right ) = -\sqrt {2}\, \sqrt {c_1} \end{align*}

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

\begin{align*} y &= -\sqrt {-\frac {2 \tan \left (x +c_3 \right )^{2} c_1}{\tan \left (x +c_3 \right )^{2}+1}+2 c_1} \\ y &= 0 \\ y &= 0 \\ \end{align*}
Simplifying the above gives
\begin{align*} y &= \sqrt {2}\, \sqrt {c_1} \\ y &= \sqrt {c_1 \left (1+\cos \left (2 c_2 +2 x \right )\right )} \\ y &= 0 \\ y &= 0 \\ y &= -\sqrt {2}\, \sqrt {c_1} \\ y &= -\sqrt {c_1 \left (1+\cos \left (2 x +2 c_3 \right )\right )} \\ y &= 0 \\ y &= 0 \\ \end{align*}
The solution
\[ y = 0 \]
was found not to satisfy the ode or the IC. Hence it is removed. The solution
\[ y = \sqrt {2}\, \sqrt {c_1} \]
was found not to satisfy the ode or the IC. Hence it is removed. The solution
\[ y = -\sqrt {2}\, \sqrt {c_1} \]
was found not to satisfy the ode or the IC. Hence it is removed.

Summary of solutions found

\begin{align*} y &= \sqrt {c_1 \left (1+\cos \left (2 c_2 +2 x \right )\right )} \\ y &= -\sqrt {c_1 \left (1+\cos \left (2 x +2 c_3 \right )\right )} \\ \end{align*}
Figure 2.112: Slope field \(y^{\prime \prime }+y = 0\)
2.7.2.3 second order kovacic

0.071 (sec)

\begin{align*} y^{\prime \prime }+y&=0 \\ \end{align*}
Entering kovacic solverWriting the ode as
\begin{align*} y^{\prime \prime }+y &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end{align*}

Comparing (1) and (2) shows that

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

Applying the Liouville transformation on the dependent variable gives

\begin{align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end{align*}

Then (2) becomes

\begin{align*} z''(x) = r z(x)\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 {-1}{1}\tag {6} \end{align*}

Comparing the above to (5) shows that

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

Therefore eq. (4) becomes

\begin{align*} z''(x) &= -z \left (x \right ) \tag {7} \end{align*}

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

\begin{align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \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.18: 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 = -1\) is not a function of \(x\), then there is no need run Kovacic algorithm to obtain a solution for transformed ode \(z''=r z\) as one solution is

\[ z_1(x) = \cos \left (x \right ) \]
Using the above, the solution for the original ode can now be found. The first solution to the original ode in \(y\) is found from
\[ y_1 = z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \]

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

\begin{align*} y_1 &= z_1 \\ &= \cos \left (x \right ) \\ \end{align*}
Which simplifies to
\[ y_1 = \cos \left (x \right ) \]
The second solution \(y_2\) to the original ode is found using reduction of order
\[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \]
Since \(B=0\) then the above becomes
\begin{align*} y_2 &= y_1 \int \frac {1}{y_1^2} \,dx \\ &= \cos \left (x \right )\int \frac {1}{\cos \left (x \right )^{2}} \,dx \\ &= \cos \left (x \right )\left (\tan \left (x \right )\right ) \\ \end{align*}
Therefore the solution is
\begin{align*} y &= c_1 y_1 + c_2 y_2 \\ &= c_1 \left (\cos \left (x \right )\right ) + c_2 \left (\cos \left (x \right )\left (\tan \left (x \right )\right )\right ) \\ \end{align*}

Summary of solutions found

\begin{align*} y &= \cos \left (x \right ) c_1 +c_2 \sin \left (x \right ) \\ \end{align*}
Figure 2.113: Slope field \(y^{\prime \prime }+y = 0\)
2.7.2.4 SSolved using second order ode arccos transformation

0.239 (sec)

\begin{align*} y^{\prime \prime }+y&=0 \\ \end{align*}

Applying change of variable \(x = \arccos \left (\tau \right )\) to the above ode results in the following new ode

\[ \left (-\tau ^{2}+1\right ) \left (\frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )\right )-\left (\frac {d}{d \tau }y \left (\tau \right )\right ) \tau +y \left (\tau \right ) = 0 \]
Which is now solved for \(y \left (\tau \right )\). Entering second order linear exact ode solverAn ode of the form
\begin{align*} p \left (\tau \right ) \left (\frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )\right )+q \left (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+r \left (\tau \right ) y \left (\tau \right )&=s \left (\tau \right ) \end{align*}

is exact if

\begin{align*} p''(\tau ) - q'(\tau ) + r(\tau ) &= 0 \tag {1} \end{align*}

For the given ode we have

\begin{align*} p(x) &= -\tau ^{2}+1\\ q(x) &= -\tau \\ r(x) &= 1\\ s(x) &= 0 \end{align*}

Hence

\begin{align*} p''(x) &= -2\\ q'(x) &= -1 \end{align*}

Therefore (1) becomes

\begin{align*} -2- \left (-1\right ) + \left (1\right )&=0 \end{align*}

Hence the ode is exact. Since we now know the ode is exact, it can be written as

\begin{align*} \left (p \left (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+\left (q \left (\tau \right )-\frac {d}{d \tau }p \left (\tau \right )\right ) y \left (\tau \right )\right )' &= s(x) \end{align*}

Integrating gives

\begin{align*} p \left (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+\left (q \left (\tau \right )-\frac {d}{d \tau }p \left (\tau \right )\right ) y \left (\tau \right )&=\int {s \left (\tau \right )\, d\tau } \end{align*}

Substituting the above values for \(p,q,r,s\) gives

\begin{align*} \left (-\tau ^{2}+1\right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+y \left (\tau \right ) \tau &=c_1 \end{align*}

We now have a first order ode to solve which is

\begin{align*} \left (-\tau ^{2}+1\right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+y \left (\tau \right ) \tau = c_1 \end{align*}

Entering first order ode linear solverIn canonical form a linear first order is

\begin{align*} \frac {d}{d \tau }y \left (\tau \right ) + q(\tau )y \left (\tau \right ) &= p(\tau ) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(\tau ) &=-\frac {\tau }{\tau ^{2}-1}\\ p(\tau ) &=-\frac {c_1}{\tau ^{2}-1} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,d\tau }}\\ &= {\mathrm e}^{\int -\frac {\tau }{\tau ^{2}-1}d \tau }\\ &= \frac {1}{\sqrt {\tau ^{2}-1}} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }}\left ( \mu y\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }}\left ( \mu y\right ) &= \left (\mu \right ) \left (-\frac {c_1}{\tau ^{2}-1}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }} \left (\frac {y}{\sqrt {\tau ^{2}-1}}\right ) &= \left (\frac {1}{\sqrt {\tau ^{2}-1}}\right ) \left (-\frac {c_1}{\tau ^{2}-1}\right ) \\ \mathrm {d} \left (\frac {y}{\sqrt {\tau ^{2}-1}}\right ) &= \left (-\frac {c_1}{\left (\tau ^{2}-1\right )^{{3}/{2}}}\right )\, \mathrm {d} \tau \\ \end{align*}
Integrating gives
\begin{align*} \frac {y}{\sqrt {\tau ^{2}-1}}&= \int {-\frac {c_1}{\left (\tau ^{2}-1\right )^{{3}/{2}}} \,d\tau } \\ &=\frac {c_1 \tau }{\sqrt {\tau ^{2}-1}} + c_2 \end{align*}

Dividing throughout by the integrating factor \(\frac {1}{\sqrt {\tau ^{2}-1}}\) gives the final solution

\[ y \left (\tau \right ) = c_2 \sqrt {\tau ^{2}-1}+c_1 \tau \]
Applying change of variable \(\tau = \cos \left (x \right )\) to the solutions above gives
\begin{align*} y &= c_2 \sqrt {\cos \left (x \right )^{2}-1}+\cos \left (x \right ) c_1 \\ \end{align*}
Figure 2.114: Slope field \(y^{\prime \prime }+y = 0\)
2.7.2.5 Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=diff(diff(y(x),x),x)+y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 \sin \left (x \right )+c_2 \cos \left (x \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^{2}}{d x^{2}}y \left (x \right )+y \left (x \right )=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right ) \\ \bullet & {} & \textrm {Characteristic polynomial of ODE}\hspace {3pt} \\ {} & {} & r^{2}+1=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {0\pm \left (\sqrt {-4}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (\mathrm {-I}, \mathrm {I}\right ) \\ \bullet & {} & \textrm {1st solution of the ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )=\cos \left (x \right ) \\ \bullet & {} & \textrm {2nd solution of the ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )=\sin \left (x \right ) \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} y_{1}\left (x \right )+\mathit {C2} y_{2}\left (x \right ) \\ \bullet & {} & \textrm {Substitute in solutions}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} \cos \left (x \right )+\mathit {C2} \sin \left (x \right ) \end {array} \]
2.7.2.6 Mathematica. Time used: 0.007 (sec). Leaf size: 16
ode=D[y[x],{x,2}]+y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 \cos (x)+c_2 \sin (x) \end{align*}
2.7.2.7 Sympy. Time used: 0.021 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} \]