2.2.9 problem 6 (ii)

Existence and uniqueness analysis
Solved as second order linear constant coeff ode
Solved as second order can be made integrable
Solved as second order ode using Kovacic algorithm
Solved as second order ode adjoint method
Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [18198]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 4. Autonomous systems. Exercises at page 69
Problem number : 6 (ii)
Date solved : Thursday, December 19, 2024 at 06:17:56 PM
CAS classification : [[_2nd_order, _missing_x]]

Solve

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

With initial conditions

\begin{align*} x \left (0\right )&=0\\ x^{\prime }\left (0\right )&=1 \end{align*}

Existence and uniqueness analysis

This is a linear ODE. In canonical form it is written as

\begin{align*} x^{\prime \prime } + p(t)x^{\prime } + q(t) x &= F \end{align*}

Where here

\begin{align*} p(t) &=0\\ q(t) &=1\\ F &=0 \end{align*}

Hence the ode is

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

The domain of \(p(t)=0\) is

\[ \{-\infty <t <\infty \} \]

And the point \(t_0 = 0\) is inside this domain. The domain of \(q(t)=1\) is

\[ \{-\infty <t <\infty \} \]

And the point \(t_0 = 0\) is also inside this domain. Hence solution exists and is unique.

Solved as second order linear constant coeff ode

Time used: 0.097 (sec)

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

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

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

\[ \lambda ^{2} {\mathrm e}^{t \lambda }+{\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}+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

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

Which becomes

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

Or

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

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} x &= \sin \left (t \right ) \\ \end{align*}

(a) Solution plot
\(x = \sin \left (t \right )\)

(b) Slope field plot
\(x^{\prime \prime }+x = 0\)
Solved as second order can be made integrable

Time used: 0.879 (sec)

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

\[ x^{\prime } x^{\prime \prime }+x^{\prime } x = 0 \]

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

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

Which is now solved for \(x\). Solving for the derivative gives these ODE’s to solve

\begin{align*} \tag{1} x^{\prime }&=\sqrt {-x^{2}+2 c_1} \\ \tag{2} x^{\prime }&=-\sqrt {-x^{2}+2 c_1} \\ \end{align*}

Now each of the above is solved separately.

Solving Eq. (1)

Integrating gives

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

Singular solutions are found by solving

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

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

Solving for \(x\) gives

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

Solving Eq. (2)

Integrating gives

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

Singular solutions are found by solving

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

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

Solving for \(x\) gives

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

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} x &= \tan \left (t \right ) \sqrt {\frac {1}{1+\tan \left (t \right )^{2}}} \\ \end{align*}

(a) Solution plot
\(x = \tan \left (t \right ) \sqrt {\frac {1}{1+\tan \left (t \right )^{2}}}\)

(b) Slope field plot
\(x^{\prime \prime }+x = 0\)
Solved as second order ode using Kovacic algorithm

Time used: 0.077 (sec)

Writing the ode as

\begin{align*} x^{\prime \prime }+x &= 0 \tag {1} \\ A x^{\prime \prime } + B x^{\prime } + C x &= 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(t) &= x 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 {-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''(t) &= -z \left (t \right ) \tag {7} \end{align*}

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

\begin{align*} x &= 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 = -1\) 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) = \cos \left (t \right ) \]

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

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

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

\begin{align*} x_1 &= z_1 \\ &= \cos \left (t \right ) \\ \end{align*}

Which simplifies to

\[ x_1 = \cos \left (t \right ) \]

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

\[ x_2 = x_1 \int \frac { e^{\int -\frac {B}{A} \,dt}}{x_1^2} \,dt \]

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

\begin{align*} x_2 &= x_1 \int \frac {1}{x_1^2} \,dt \\ &= \cos \left (t \right )\int \frac {1}{\cos \left (t \right )^{2}} \,dt \\ &= \cos \left (t \right )\left (\tan \left (t \right )\right ) \\ \end{align*}

Therefore the solution is

\begin{align*} x &= c_1 x_1 + c_2 x_2 \\ &= c_1 \left (\cos \left (t \right )\right ) + c_2 \left (\cos \left (t \right )\left (\tan \left (t \right )\right )\right ) \\ \end{align*}

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} x &= \sin \left (t \right ) \\ \end{align*}

(a) Solution plot
\(x = \sin \left (t \right )\)

(b) Slope field plot
\(x^{\prime \prime }+x = 0\)
Solved as second order ode adjoint method

Time used: 0.393 (sec)

In normal form the ode

\begin{align*} x^{\prime \prime }+x = 0 \tag {1} \end{align*}

Becomes

\begin{align*} x^{\prime \prime }+p \left (t \right ) x^{\prime }+q \left (t \right ) x&=r \left (t \right ) \tag {2} \end{align*}

Where

\begin{align*} p \left (t \right )&=0\\ q \left (t \right )&=1\\ r \left (t \right )&=0 \end{align*}

The Lagrange adjoint ode is given by

\begin{align*} \xi ^{''}-(\xi \, p)'+\xi q &= 0\\ \xi ^{''}-\left (0\right )' + \left (\xi \left (t \right )\right ) &= 0\\ \xi ^{\prime \prime }\left (t \right )+\xi \left (t \right )&= 0 \end{align*}

Which is solved for \(\xi (t)\). This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

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

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

\[ \lambda ^{2} {\mathrm e}^{t \lambda }+{\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}+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

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

Which becomes

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

Or

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

Will add steps showing solving for IC soon.

The original ode now reduces to first order ode

\begin{align*} \xi \left (t \right ) x^{\prime }-x \xi ^{\prime }\left (t \right )+\xi \left (t \right ) p \left (t \right ) x&=\int \xi \left (t \right ) r \left (t \right )d t\\ x^{\prime }+x \left (p \left (t \right )-\frac {\xi ^{\prime }\left (t \right )}{\xi \left (t \right )}\right )&=\frac {\int \xi \left (t \right ) r \left (t \right )d t}{\xi \left (t \right )} \end{align*}

Or

\begin{align*} x^{\prime }-\frac {x \left (-c_1 \sin \left (t \right )+c_2 \cos \left (t \right )\right )}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )}&=0 \end{align*}

Which is now a first order ode. This is now solved for \(x\). In canonical form a linear first order is

\begin{align*} x^{\prime } + q(t)x &= p(t) \end{align*}

Comparing the above to the given ode shows that

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

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dt}}\\ &= {\mathrm e}^{\int -\frac {-c_1 \sin \left (t \right )+c_2 \cos \left (t \right )}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )}d t}\\ &= \frac {1}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}} \mu x &= 0 \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}} \left (\frac {x}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )}\right ) &= 0 \end{align*}

Integrating gives

\begin{align*} \frac {x}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )}&= \int {0 \,dt} + c_3 \\ &=c_3 \end{align*}

Dividing throughout by the integrating factor \(\frac {1}{c_1 \cos \left (t \right )+c_2 \sin \left (t \right )}\) gives the final solution

\[ x = \left (c_1 \cos \left (t \right )+c_2 \sin \left (t \right )\right ) c_3 \]

Hence, the solution found using Lagrange adjoint equation method is

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

The constants can be merged to give

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

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} x &= \sin \left (t \right ) \\ \end{align*}

(a) Solution plot
\(x = \sin \left (t \right )\)

(b) Slope field plot
\(x^{\prime \prime }+x = 0\)
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [x^{\prime \prime }+x=0, x \left (0\right )=0, x^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{t \hiderel {=}0\right \}}}}=1\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & x^{\prime \prime } \\ \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} \\ {} & {} & x_{1}\left (t \right )=\cos \left (t \right ) \\ \bullet & {} & \textrm {2nd solution of the ODE}\hspace {3pt} \\ {} & {} & x_{2}\left (t \right )=\sin \left (t \right ) \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & x=\mathit {C1} x_{1}\left (t \right )+\mathit {C2} x_{2}\left (t \right ) \\ \bullet & {} & \textrm {Substitute in solutions}\hspace {3pt} \\ {} & {} & x=\mathit {C1} \cos \left (t \right )+\mathit {C2} \sin \left (t \right ) \\ \square & {} & \textrm {Check validity of solution}\hspace {3pt} x=\textit {\_C1} \cos \left (t \right )+\textit {\_C2} \sin \left (t \right ) \\ {} & \circ & \textrm {Use initial condition}\hspace {3pt} x \left (0\right )=0 \\ {} & {} & 0=\textit {\_C1} \\ {} & \circ & \textrm {Compute derivative of the solution}\hspace {3pt} \\ {} & {} & x^{\prime }=-\textit {\_C1} \sin \left (t \right )+\textit {\_C2} \cos \left (t \right ) \\ {} & \circ & \textrm {Use the initial condition}\hspace {3pt} x^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{t \hiderel {=}0\right \}}}}=1 \\ {} & {} & 1=\textit {\_C2} \\ {} & \circ & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \hspace {3pt}\textrm {and}\hspace {3pt} \textit {\_C2} \\ {} & {} & \left \{\textit {\_C1} =0, \textit {\_C2} =1\right \} \\ {} & \circ & \textrm {Substitute constant values into general solution and simplify}\hspace {3pt} \\ {} & {} & x=\sin \left (t \right ) \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & x=\sin \left (t \right ) \end {array} \]

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

Solving time : 0.005 (sec)
Leaf size : 6

dsolve([diff(diff(x(t),t),t)+x(t) = 0, 
       op([x(0) = 0, D(x)(0) = 1])],x(t),singsol=all)
 
\[ x = \sin \left (t \right ) \]
Mathematica DSolve solution

Solving time : 0.01 (sec)
Leaf size : 7

DSolve[{D[x[t],{t,2}]+x[t]==0,{x[0]==0,Derivative[1][x][0] == 1}}, 
       x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \sin (t) \]