22.9 problem 9

22.9.1 Solving as series ode
22.9.2 Maple step by step solution

Internal problem ID [2372]
Internal file name [OUTPUT/2372_Tuesday_February_27_2024_08_36_21_AM_53635095/index.tex]

Book: Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section: Exercise 40, page 186
Problem number: 9.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "first order ode series method. Taylor series method"

Maple gives the following as the ode type

[`y=_G(x,y')`]

\[ \boxed {y^{\prime }-\sin \left (y\right )=\cos \left (x \right )} \] With initial conditions \begin {align*} \left [y \left (\frac {\pi }{2}\right ) = \frac {\pi }{2}\right ] \end {align*}

With the expansion point for the power series method at \(x = \frac {\pi }{2}\).

22.9.1 Solving as series ode

The ode does not have its expansion point at \(x = 0\), therefore to simplify the computation of power series expansion, change of variable is made on the independent variable to shift the initial conditions and the expasion point back to zero. The new ode is then solved more easily since the expansion point is now at zero. The solution converted back to the original independent variable. Let \[ t = x -\frac {\pi }{2} \] The ode is converted to be in terms of the new independent variable \(t\). This results in \[ \frac {d}{d t}y \left (t \right )-\sin \left (y \left (t \right )\right ) = -\sin \left (t \right ) \] With its expansion point and initial conditions now at \(t = 0\). With initial conditions now becoming \begin {align*} y(0) &= \frac {\pi }{2}\\ \end {align*}

The transformed ODE is now solved.

Solving ode using Taylor series method. This gives review on how the Taylor series method works for solving first order ode. Let \[ y^{\prime }=f\left ( x,y\right ) \] Where \(f\left ( x,y\right ) \) is analytic at expansion point \(x_{0}\). We can always shift to \(x_{0}=0\) if \(x_{0}\) is not zero. So from now we assume \(x_{0}=0\,\). Assume also that \(y\left ( x_{0}\right ) =y_{0}\). Using Taylor series\begin {align*} y\left ( x\right ) & =y\left ( x_{0}\right ) +\left ( x-x_{0}\right ) y^{\prime }\left ( x_{0}\right ) +\frac {\left ( x-x_{0}\right ) ^{2}}{2}y^{\prime \prime }\left ( x_{0}\right ) +\frac {\left ( x-x_{0}\right ) ^{3}}{3!}y^{\prime \prime }\left ( x_{0}\right ) +\cdots \\ & =y_{0}+xf+\frac {x^{2}}{2}\left . \frac {df}{dx}\right \vert _{x_{0},y_{0}}+\frac {x^{3}}{3!}\left . \frac {d^{2}f}{dx^{2}}\right \vert _{x_{0},y_{0}}+\cdots \\ & =y_{0}+\sum _{n=0}^{\infty }\frac {x^{n+1}}{\left ( n+1\right ) !}\left . \frac {d^{n}f}{dx^{n}}\right \vert _{x_{0},y_{0}} \end {align*}

But \begin {align} \frac {df}{dx} & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}f\tag {1}\\ \frac {d^{2}f}{dx^{2}} & =\frac {d}{dx}\left ( \frac {df}{dx}\right ) \nonumber \\ & =\frac {\partial }{\partial x}\left ( \frac {df}{dx}\right ) +\frac {\partial }{\partial y}\left ( \frac {df}{dx}\right ) f\tag {2}\\ \frac {d^{3}f}{dx^{3}} & =\frac {d}{dx}\left ( \frac {d^{2}f}{dx^{2}}\right ) \nonumber \\ & =\frac {\partial }{\partial x}\left ( \frac {d^{2}f}{dx^{2}}\right ) +\left ( \frac {\partial }{\partial y}\frac {d^{2}f}{dx^{2}}\right ) f\tag {3}\\ & \vdots \nonumber \end {align}

And so on. Hence if we name \(F_{0}=f\left ( x,y\right ) \) then the above can be written as \begin {align} F_{0} & =f\left ( x,y\right ) \tag {4}\\ F_{n} & =\frac {d}{dx}\left ( F_{n-1}\right ) \nonumber \\ & =\frac {\partial }{\partial x}F_{n-1}+\left ( \frac {\partial F_{n-1}}{\partial y}\right ) F_{0} \tag {5} \end {align}

For example, for \(n=1\,\) we see that \begin {align*} F_{1} & =\frac {d}{dx}\left ( F_{0}\right ) \\ & =\frac {\partial }{\partial x}F_{0}+\left ( \frac {\partial F_{0}}{\partial y}\right ) F_{0}\\ & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}f \end {align*}

Which is (1). And when \(n=2\)\begin {align*} F_{2} & =\frac {d}{dx}\left ( F_{1}\right ) \\ & =\frac {\partial }{\partial x}F_{1}+\left ( \frac {\partial F_{1}}{\partial y}\right ) F_{0}\\ & =\frac {\partial }{\partial x}\left ( \frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}f\right ) +\frac {\partial }{\partial y}\left ( \frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}f\right ) f\\ & =\frac {\partial }{\partial x}\left ( \frac {df}{dx}\right ) +\frac {\partial }{\partial y}\left ( \frac {df}{dx}\right ) f \end {align*}

Which is (2) and so on. Therefore (4,5) can be used from now on along with \begin {equation} y\left ( x\right ) =y_{0}+\sum _{n=0}^{\infty }\frac {x^{n+1}}{\left ( n+1\right ) !}\left . F_{n}\right \vert _{x_{0},y_{0}} \tag {6} \end {equation} Hence \begin {align*} F_0 &= \sin \left (y \left (t \right )\right )-\sin \left (t \right )\\ F_1 &= \frac {d F_0}{dt} \\ &= \frac {\partial F_0}{\partial t}+ \frac {\partial F_0}{\partial y} F_0 \\ &= \left (\sin \left (y \left (t \right )\right )-\sin \left (t \right )\right ) \cos \left (y \left (t \right )\right )-\cos \left (t \right )\\ F_2 &= \frac {d F_1}{dt} \\ &= \frac {\partial F_1}{\partial t}+ \frac {\partial F_1}{\partial y} F_1 \\ &= 3 \sin \left (y \left (t \right )\right )^{2} \sin \left (t \right )+\sin \left (y \left (t \right )\right ) \cos \left (t \right )^{2}-2 \sin \left (y \left (t \right )\right )^{3}-\cos \left (y \left (t \right )\right ) \cos \left (t \right ) \end {align*}

And so on. Evaluating all the above at initial conditions \(t \left (0\right ) = 0\) and \(y \left (0\right ) = \frac {\pi }{2}\) gives \begin {align*} F_0 &= 1\\ F_1 &= -1\\ F_2 &= -1 \end {align*}

Substituting all the above in (6) and simplifying gives the solution as \[ y \left (t \right ) = t +\frac {\pi }{2}-\frac {t^{2}}{2}-\frac {t^{3}}{6}+O\left (t^{4}\right ) \] Now we substitute the given initial conditions in the above to solve for \(y \left (0\right )\). Solving for \(y \left (0\right )\) from initial conditions gives \begin {align*} y \left (0\right ) = y \left (0\right ) \end {align*}

Therefore the solution becomes \begin {align*} y \left (t \right ) = t +\frac {1}{2} \pi -\frac {1}{2} t^{2}-\frac {1}{6} t^{3} \end {align*}

Hence the solution can be written as \begin {gather*} y \left (t \right ) = t +\frac {\pi }{2}-\frac {t^{2}}{2}-\frac {t^{3}}{6}+O\left (t^{4}\right ) \end {gather*} which simplifies to \begin {gather*} y \left (t \right ) = t +\frac {\pi }{2}-\frac {t^{2}}{2}-\frac {t^{3}}{6}+O\left (t^{4}\right ) \end {gather*} Unable to also solve using normal power series since not linear ode. Not currently supported. Replacing \(t\) in the above with the original independent variable \(xs\) using \(t = x -\frac {\pi }{2}\) results in \begin {gather*} y = x -\frac {\left (x -\frac {\pi }{2}\right )^{2}}{2}-\frac {\left (x -\frac {\pi }{2}\right )^{3}}{6}+O\left (\left (x -\frac {\pi }{2}\right )^{4}\right ) \end {gather*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= x -\frac {\left (x -\frac {\pi }{2}\right )^{2}}{2}-\frac {\left (x -\frac {\pi }{2}\right )^{3}}{6}+O\left (\left (x -\frac {\pi }{2}\right )^{4}\right ) \\ \end{align*}

Verification of solutions

\[ y = x -\frac {\left (x -\frac {\pi }{2}\right )^{2}}{2}-\frac {\left (x -\frac {\pi }{2}\right )^{3}}{6}+O\left (\left (x -\frac {\pi }{2}\right )^{4}\right ) \] Verified OK.

22.9.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }-\sin \left (y\right )=\cos \left (x \right ), y \left (\frac {\pi }{2}\right )=\frac {\pi }{2}\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=\cos \left (x \right )+\sin \left (y\right ) \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (\frac {\pi }{2}\right )=\frac {\pi }{2} \\ {} & {} & 0 \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} 0 \\ {} & {} & 0=0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} 0=0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & 0 \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & 0 \end {array} \]

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying Chini 
differential order: 1; looking for linear symmetries 
trying exact 
Looking for potential symmetries 
trying inverse_Riccati 
trying an equivalence to an Abel ODE 
differential order: 1; trying a linearization to 2nd order 
--- trying a change of variables {x -> y(x), y(x) -> x} 
differential order: 1; trying a linearization to 2nd order 
trying 1st order ODE linearizable_by_differentiation 
--- Trying Lie symmetry methods, 1st order --- 
`, `-> Computing symmetries using: way = 3 
`, `-> Computing symmetries using: way = 4 
`, `-> Computing symmetries using: way = 5 
trying symmetry patterns for 1st order ODEs 
-> trying a symmetry pattern of the form [F(x)*G(y), 0] 
-> trying a symmetry pattern of the form [0, F(x)*G(y)] 
-> trying symmetry patterns of the forms [F(x),G(y)] and [G(y),F(x)] 
-> trying a symmetry pattern of the form [F(x),G(x)] 
-> trying a symmetry pattern of the form [F(y),G(y)] 
-> trying a symmetry pattern of the form [F(x)+G(y), 0] 
-> trying a symmetry pattern of the form [0, F(x)+G(y)] 
-> trying a symmetry pattern of the form [F(x),G(x)*y+H(x)] 
-> trying a symmetry pattern of conformal type`
 

Solution by Maple

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

Order:=4; 
dsolve([diff(y(x),x)=cos(x)+sin(y(x)),y(1/2*Pi) = 1/2*Pi],y(x),type='series',x=1/2*Pi);
 

\[ y \left (x \right ) = \frac {\pi }{2}+\left (-\frac {\pi }{2}+x \right )-\frac {1}{2} \left (-\frac {\pi }{2}+x \right )^{2}-\frac {1}{6} \left (-\frac {\pi }{2}+x \right )^{3}+\operatorname {O}\left (\left (-\frac {\pi }{2}+x \right )^{4}\right ) \]

Solution by Mathematica

Time used: 0.088 (sec). Leaf size: 22

AsymptoticDSolveValue[{y'[x]==Cos[x]*Sin[y[x]],{y[Pi/2]==Pi/2}},y[x],{x,1/2*Pi,3}]
 

\[ y(x)\to \frac {\pi }{2}-\frac {1}{2} \left (x-\frac {\pi }{2}\right )^2 \]