2.1.89 problem 88

Solved as second order linear constant coeff ode
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 [8227]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 88
Date solved : Sunday, November 10, 2024 at 03:28:50 AM
CAS classification : [[_2nd_order, _missing_x]]

Solve

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

With initial conditions

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

Solved as second order linear constant coeff ode

Time used: 0.166 (sec)

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=1, C=1\). Let the solution be \(y=e^{\lambda x}\). Substituting this into the ODE gives

\[ \lambda ^{2} {\mathrm e}^{x \lambda }+\lambda \,{\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}+\lambda +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=1, C=1\) into the above gives

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

Hence

\begin{align*} \lambda _1 &= -{\frac {1}{2}} + \frac {i \sqrt {3}}{2}\\ \lambda _2 &= -{\frac {1}{2}} - \frac {i \sqrt {3}}{2} \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= -\frac {1}{2}+\frac {i \sqrt {3}}{2} \\ \lambda _2 &= -\frac {1}{2}-\frac {i \sqrt {3}}{2} \\ \end{align*}

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

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

Where \(\alpha =-{\frac {1}{2}}\) and \(\beta =\frac {\sqrt {3}}{2}\). 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^{-\frac {x}{2}}\left (c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right ) \]

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} y &= {\mathrm e}^{-\frac {x}{2}} \left (c_2 \sqrt {3}\, \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right ) \\ \end{align*}
Figure 2.177: Slope field plot
\(y^{\prime \prime }+y^{\prime }+y = 0\)
Solved as second order ode using Kovacic algorithm

Time used: 0.148 (sec)

Writing the ode as

\begin{align*} y^{\prime \prime }+y^{\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 &= 1\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 {-3}{4}\tag {6} \end{align*}

Comparing the above to (5) shows that

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

Therefore eq. (4) becomes

\begin{align*} z''(x) &= -\frac {3 z \left (x \right )}{4} \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 = -{\frac {3}{4}}\) 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 (\frac {\sqrt {3}\, x}{2}\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

\begin{align*} y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\ &= z_1 e^{ -\int \frac {1}{2} \frac {1}{1} \,dx} \\ &= z_1 e^{-\frac {x}{2}} \\ &= z_1 \left ({\mathrm e}^{-\frac {x}{2}}\right ) \\ \end{align*}

Which simplifies to

\[ y_1 = {\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\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 \]

Substituting gives

\begin{align*} y_2 &= y_1 \int \frac { e^{\int -\frac {1}{1} \,dx}}{\left (y_1\right )^2} \,dx \\ &= y_1 \int \frac { e^{-x}}{\left (y_1\right )^2} \,dx \\ &= y_1 \left (\frac {2 \sqrt {3}\, \tan \left (\frac {\sqrt {3}\, x}{2}\right )}{3}\right ) \\ \end{align*}

Therefore the solution is

\begin{align*} y &= c_1 y_1 + c_2 y_2 \\ &= c_1 \left ({\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right )\right ) + c_2 \left ({\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right )\left (\frac {2 \sqrt {3}\, \tan \left (\frac {\sqrt {3}\, x}{2}\right )}{3}\right )\right ) \\ \end{align*}

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} y &= 2 c_2 \,{\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right )+\frac {2 c_2 \sqrt {3}\, {\mathrm e}^{-\frac {x}{2}} \sin \left (\frac {\sqrt {3}\, x}{2}\right )}{3} \\ \end{align*}
Figure 2.178: Slope field plot
\(y^{\prime \prime }+y^{\prime }+y = 0\)
Solved as second order ode adjoint method

Time used: 1.243 (sec)

In normal form the ode

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

Becomes

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

Where

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

The Lagrange adjoint ode is given by

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

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

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

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

\[ \lambda ^{2} {\mathrm e}^{x \lambda }-\lambda \,{\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}-\lambda +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=-1, C=1\) into the above gives

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

Hence

\begin{align*} \lambda _1 &= {\frac {1}{2}} + \frac {i \sqrt {3}}{2}\\ \lambda _2 &= {\frac {1}{2}} - \frac {i \sqrt {3}}{2} \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= \frac {1}{2}+\frac {i \sqrt {3}}{2} \\ \lambda _2 &= \frac {1}{2}-\frac {i \sqrt {3}}{2} \\ \end{align*}

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

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

Where \(\alpha ={\frac {1}{2}}\) and \(\beta =\frac {\sqrt {3}}{2}\). Therefore the final solution, when using Euler relation, can be written as

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

Which becomes

\[ \xi = e^{\frac {x}{2}}\left (c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right ) \]

Will add steps showing solving for IC soon.

The original ode now reduces to first order ode

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

Or

\begin{align*} y^{\prime }+y \left (1-\frac {\left (\frac {{\mathrm e}^{\frac {x}{2}} \left (c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{2}+{\mathrm e}^{\frac {x}{2}} \left (-\frac {c_1 \sqrt {3}\, \sin \left (\frac {\sqrt {3}\, x}{2}\right )}{2}+\frac {c_2 \sqrt {3}\, \cos \left (\frac {\sqrt {3}\, x}{2}\right )}{2}\right )\right ) {\mathrm e}^{-\frac {x}{2}}}{c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )}\right )&=0 \end{align*}

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

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

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\frac {c_2 \sqrt {3}\, \cos \left (\frac {\sqrt {3}\, x}{2}\right )-c_1 \sqrt {3}\, \sin \left (\frac {\sqrt {3}\, x}{2}\right )-c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )-c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )}{2 \left (c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right )}\\ p(x) &=0 \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {c_2 \sqrt {3}\, \cos \left (\frac {\sqrt {3}\, x}{2}\right )-c_1 \sqrt {3}\, \sin \left (\frac {\sqrt {3}\, x}{2}\right )-c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )-c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )}{2 \left (c_1 \cos \left (\frac {\sqrt {3}\, x}{2}\right )+c_2 \sin \left (\frac {\sqrt {3}\, x}{2}\right )\right )}d x}\\ &= \frac {\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}\, {\mathrm e}^{\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \mu y &= 0 \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {y \sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}\, {\mathrm e}^{\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1}\right ) &= 0 \end{align*}

Integrating gives

\begin{align*} \frac {y \sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}\, {\mathrm e}^{\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1}&= \int {0 \,dx} + c_3 \\ &=c_3 \end{align*}

Dividing throughout by the integrating factor \(\frac {\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}\, {\mathrm e}^{\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1}\) gives the final solution

\[ y = \frac {\left (\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1 \right ) {\mathrm e}^{-\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}} c_3}{\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}} \]

Hence, the solution found using Lagrange adjoint equation method is

\begin{align*} y &= \frac {\left (\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1 \right ) {\mathrm e}^{-\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}} c_3}{\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}} \\ \end{align*}

The constants can be merged to give

\[ y = \frac {\left (\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_1 \right ) {\mathrm e}^{-\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}} \]

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} y &= \frac {\left (\tan \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +c_2 \sqrt {3}\right ) {\mathrm e}^{-\frac {\sqrt {3}\, \arctan \left (\tan \left (\frac {\sqrt {3}\, x}{2}\right )\right )}{3}}}{\sqrt {\sec \left (\frac {\sqrt {3}\, x}{2}\right )^{2}}} \\ \end{align*}
Figure 2.179: Slope field plot
\(y^{\prime \prime }+y^{\prime }+y = 0\)
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d^{2}}{d x^{2}}y \left (x \right )+\frac {d}{d x}y \left (x \right )+y \left (x \right )=0, \left (\frac {d}{d x}y \left (x \right )\right )\bigg | {\mstack {}{_{\left \{x \hiderel {=}0\right \}}}}=0\right ] \\ \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}+r +1=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {\left (-1\right )\pm \left (\sqrt {-3}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (-\frac {1}{2}-\frac {\mathrm {I} \sqrt {3}}{2}, -\frac {1}{2}+\frac {\mathrm {I} \sqrt {3}}{2}\right ) \\ \bullet & {} & \textrm {1st solution of the ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )={\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right ) \\ \bullet & {} & \textrm {2nd solution of the ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )={\mathrm e}^{-\frac {x}{2}} \sin \left (\frac {\sqrt {3}\, x}{2}\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} \,{\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right )+\mathit {C2} \,{\mathrm e}^{-\frac {x}{2}} \sin \left (\frac {\sqrt {3}\, x}{2}\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.033 (sec)
Leaf size : 29

dsolve([diff(diff(y(x),x),x)+diff(y(x),x)+y(x) = 0, 
       op([D(y)(0) = 0])],y(x),singsol=all)
 
\[ y = {\mathrm e}^{-\frac {x}{2}} c_{1} \left (\sqrt {3}\, \cos \left (\frac {\sqrt {3}\, x}{2}\right )+\sin \left (\frac {\sqrt {3}\, x}{2}\right )\right ) \]
Mathematica DSolve solution

Solving time : 0.021 (sec)
Leaf size : 44

DSolve[{D[y[x],{x,2}]+D[y[x],x]+y[x]==0,{Derivative[1][y][0] ==0}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_1 e^{-x/2} \left (\sin \left (\frac {\sqrt {3} x}{2}\right )+\sqrt {3} \cos \left (\frac {\sqrt {3} x}{2}\right )\right ) \]