1.79 problem 124

1.79.1 Solving as second order ode missing y ode
1.79.2 Maple step by step solution

Internal problem ID [12495]
Internal file name [OUTPUT/11148_Monday_October_16_2023_09_52_00_PM_71604979/index.tex]

Book: DIFFERENTIAL and INTEGRAL CALCULUS. VOL I. by N. PISKUNOV. MIR PUBLISHERS, Moscow 1969.
Section: Chapter 8. Differential equations. Exercises page 595
Problem number: 124.
ODE order: 2.
ODE degree: 1.

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

Maple gives the following as the ode type

[[_2nd_order, _missing_y]]

\[ \boxed {y^{\prime \prime }+\tan \left (x \right ) y^{\prime }=\sin \left (2 x \right )} \] With initial conditions \begin {align*} [y \left (0\right ) = -1, y^{\prime }\left (0\right ) = 0] \end {align*}

1.79.1 Solving as second order ode missing y ode

This is second order ode with missing dependent variable \(y\). Let \begin {align*} p(x) &= y^{\prime } \end {align*}

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

Hence the ode becomes \begin {align*} p^{\prime }\left (x \right )+\tan \left (x \right ) p \left (x \right )-\sin \left (2 x \right ) = 0 \end {align*}

Which is now solve for \(p(x)\) as first order ode.

Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \tan \left (x \right )d x} \\ &= \frac {1}{\cos \left (x \right )} \\ \end{align*} Which simplifies to \[ \mu = \sec \left (x \right ) \] The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu p\right ) &= \left (\mu \right ) \left (\sin \left (2 x \right )\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\sec \left (x \right ) p\right ) &= \left (\sec \left (x \right )\right ) \left (\sin \left (2 x \right )\right )\\ \mathrm {d} \left (\sec \left (x \right ) p\right ) &= \left (2 \sin \left (x \right )\right )\, \mathrm {d} x \end {align*}

Integrating gives \begin {align*} \sec \left (x \right ) p &= \int {2 \sin \left (x \right )\,\mathrm {d} x}\\ \sec \left (x \right ) p &= -2 \cos \left (x \right ) + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu =\sec \left (x \right )\) results in \begin {align*} p \left (x \right ) &= -2 \cos \left (x \right )^{2}+c_{1} \cos \left (x \right ) \end {align*}

which simplifies to \begin {align*} p \left (x \right ) &= \cos \left (x \right ) \left (-2 \cos \left (x \right )+c_{1} \right ) \end {align*}

Initial conditions are used to solve for \(c_{1}\). Substituting \(x=0\) and \(p=0\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} 0 = -2+c_{1} \end {align*}

The solutions are \begin {align*} c_{1} = 2 \end {align*}

Trying the constant \begin {align*} c_{1} = 2 \end {align*}

Substituting this in the general solution gives \begin {align*} p \left (x \right )&=-2 \cos \left (x \right ) \left (\cos \left (x \right )-1\right ) \end {align*}

The constant \(c_{1} = 2\) gives valid solution.

Since \(p=y^{\prime }\) then the new first order ode to solve is \begin {align*} y^{\prime } = -2 \cos \left (x \right ) \left (\cos \left (x \right )-1\right ) \end {align*}

Integrating both sides gives \begin {align*} y &= \int { -2 \cos \left (x \right ) \left (\cos \left (x \right )-1\right )\,\mathop {\mathrm {d}x}}\\ &= -\sin \left (x \right ) \cos \left (x \right )-x +2 \sin \left (x \right )+c_{2} \end {align*}

Initial conditions are used to solve for \(c_{2}\). Substituting \(x=0\) and \(y=-1\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} -1 = c_{2} \end {align*}

The solutions are \begin {align*} c_{2} = -1 \end {align*}

Trying the constant \begin {align*} c_{2} = -1 \end {align*}

Substituting this in the general solution gives \begin {align*} y&=-\sin \left (x \right ) \cos \left (x \right )-x +2 \sin \left (x \right )-1 \end {align*}

The constant \(c_{2} = -1\) gives valid solution.

Initial conditions are used to solve for the constants of integration.

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= -\sin \left (x \right ) \cos \left (x \right )-x +2 \sin \left (x \right )-1 \\ \end{align*}

Figure 140: Solution plot

Verification of solutions

\[ y = -\sin \left (x \right ) \cos \left (x \right )-x +2 \sin \left (x \right )-1 \] Verified OK.

1.79.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d x}y^{\prime }+\tan \left (x \right ) y^{\prime }=\sin \left (2 x \right ), y \left (0\right )=-1, y^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{x \hiderel {=}0\right \}}}}=0\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d}{d x}y^{\prime } \\ \bullet & {} & \textrm {Make substitution}\hspace {3pt} u =y^{\prime }\hspace {3pt}\textrm {to reduce order of ODE}\hspace {3pt} \\ {} & {} & u^{\prime }\left (x \right )+\tan \left (x \right ) u \left (x \right )=\sin \left (2 x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & u^{\prime }\left (x \right )=-\tan \left (x \right ) u \left (x \right )+\sin \left (2 x \right ) \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} u \left (x \right )\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & u^{\prime }\left (x \right )+\tan \left (x \right ) u \left (x \right )=\sin \left (2 x \right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (u^{\prime }\left (x \right )+\tan \left (x \right ) u \left (x \right )\right )=\mu \left (x \right ) \sin \left (2 x \right ) \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (u \left (x \right ) \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (u^{\prime }\left (x \right )+\tan \left (x \right ) u \left (x \right )\right )=u^{\prime }\left (x \right ) \mu \left (x \right )+u \left (x \right ) \mu ^{\prime }\left (x \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (x \right ) \\ {} & {} & \mu ^{\prime }\left (x \right )=\mu \left (x \right ) \tan \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )=\frac {1}{\cos \left (x \right )} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (u \left (x \right ) \mu \left (x \right )\right )\right )d x =\int \mu \left (x \right ) \sin \left (2 x \right )d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & u \left (x \right ) \mu \left (x \right )=\int \mu \left (x \right ) \sin \left (2 x \right )d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=\frac {\int \mu \left (x \right ) \sin \left (2 x \right )d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )=\frac {1}{\cos \left (x \right )} \\ {} & {} & u \left (x \right )=\cos \left (x \right ) \left (\int \frac {\sin \left (2 x \right )}{\cos \left (x \right )}d x +c_{1} \right ) \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & u \left (x \right )=\cos \left (x \right ) \left (-2 \cos \left (x \right )+c_{1} \right ) \\ \bullet & {} & \textrm {Solve 1st ODE for}\hspace {3pt} u \left (x \right ) \\ {} & {} & u \left (x \right )=\cos \left (x \right ) \left (-2 \cos \left (x \right )+c_{1} \right ) \\ \bullet & {} & \textrm {Make substitution}\hspace {3pt} u =y^{\prime } \\ {} & {} & y^{\prime }=\cos \left (x \right ) \left (-2 \cos \left (x \right )+c_{1} \right ) \\ \bullet & {} & \textrm {Integrate both sides to solve for}\hspace {3pt} y \\ {} & {} & \int y^{\prime }d x =\int \cos \left (x \right ) \left (-2 \cos \left (x \right )+c_{1} \right )d x +c_{2} \\ \bullet & {} & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y=-\sin \left (x \right ) \cos \left (x \right )-x +c_{1} \sin \left (x \right )+c_{2} \\ \square & {} & \textrm {Check validity of solution}\hspace {3pt} y=-\sin \left (x \right ) \cos \left (x \right )-x +c_{1} \sin \left (x \right )+c_{2} \\ {} & \circ & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=-1 \\ {} & {} & -1=c_{2} \\ {} & \circ & \textrm {Compute derivative of the solution}\hspace {3pt} \\ {} & {} & y^{\prime }=-\cos \left (x \right )^{2}+\sin \left (x \right )^{2}-1+c_{1} \cos \left (x \right ) \\ {} & \circ & \textrm {Use the initial condition}\hspace {3pt} y^{\prime }{\raise{-0.36em}{\Big |}}{\mstack {}{_{\left \{x \hiderel {=}0\right \}}}}=0 \\ {} & {} & 0=-2+c_{1} \\ {} & \circ & \textrm {Solve for}\hspace {3pt} c_{1} \hspace {3pt}\textrm {and}\hspace {3pt} c_{2} \\ {} & {} & \left \{c_{1} =2, c_{2} =-1\right \} \\ {} & \circ & \textrm {Substitute constant values into general solution and simplify}\hspace {3pt} \\ {} & {} & y=\sin \left (x \right ) \left (2-\cos \left (x \right )\right )-x -1 \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=\sin \left (x \right ) \left (2-\cos \left (x \right )\right )-x -1 \end {array} \]

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
-> Calling odsolve with the ODE`, diff(_b(_a), _a) = -tan(_a)*_b(_a)+sin(2*_a), _b(_a)`   *** Sublevel 2 *** 
   Methods for first order ODEs: 
   --- Trying classification methods --- 
   trying a quadrature 
   trying 1st order linear 
   <- 1st order linear successful 
<- high order exact linear fully integrable successful`
 

Solution by Maple

Time used: 0.047 (sec). Leaf size: 19

dsolve([diff(y(x),x$2)+tan(x)*diff(y(x),x)=sin(2*x),y(0) = -1, D(y)(0) = 0],y(x), singsol=all)
 

\[ y \left (x \right ) = -x -1+2 \sin \left (x \right )-\frac {\sin \left (2 x \right )}{2} \]

Solution by Mathematica

Time used: 0.154 (sec). Leaf size: 18

DSolve[{y''[x]+Tan[x]*y'[x]==Sin[2*x],{y[0]==-1,y'[0]==0}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to -x-\sin (x) (\cos (x)-2)-1 \]