4.16 problem 16

4.16.1 Existence and uniqueness analysis
4.16.2 Solving as quadrature ode
4.16.3 Maple step by step solution

Internal problem ID [12651]
Internal file name [OUTPUT/11304_Friday_November_03_2023_06_30_06_AM_4856061/index.tex]

Book: Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section: Chapter 2. The Initial Value Problem. Exercises 2.2, page 53
Problem number: 16.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[_quadrature]

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

4.16.1 Existence and uniqueness analysis

This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}

Where here \begin {align*} p(x) &=0\\ q(x) &=x^{2}+{\mathrm e}^{x}-\sin \left (x \right ) \end {align*}

Hence the ode is \begin {align*} y^{\prime } = x^{2}+{\mathrm e}^{x}-\sin \left (x \right ) \end {align*}

The domain of \(p(x)=0\) is \[ \{-\infty

4.16.2 Solving as quadrature ode

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

Initial conditions are used to solve for \(c_{1}\). Substituting \(x=2\) and \(y=-1\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} -1 = \frac {8}{3}+\cos \left (2\right )+{\mathrm e}^{2}+c_{1} \end {align*}

The solutions are \begin {align*} c_{1} = -\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \end {align*}

Trying the constant \begin {align*} c_{1} = -\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \end {align*}

Substituting this in the general solution gives \begin {align*} y&=\frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \end {align*}

The constant \(c_{1} = -\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2}\) gives valid solution.

Summary

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

(a) Solution plot

(b) Slope field plot

Verification of solutions

\[ y = \frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \] Verified OK.

4.16.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }=x^{2}+{\mathrm e}^{x}-\sin \left (x \right ), y \left (2\right )=-1\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int y^{\prime }d x =\int \left (x^{2}+{\mathrm e}^{x}-\sin \left (x \right )\right )d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & y=\frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}+c_{1} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (2\right )=-1 \\ {} & {} & -1=\frac {8}{3}+\cos \left (2\right )+{\mathrm e}^{2}+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2}\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=\frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=\frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \end {array} \]

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
<- quadrature successful`
 

Solution by Maple

Time used: 0.031 (sec). Leaf size: 23

dsolve([diff(y(x),x)=x^2+exp(x)-sin(x),y(2) = -1],y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {x^{3}}{3}+\cos \left (x \right )+{\mathrm e}^{x}-\frac {11}{3}-\cos \left (2\right )-{\mathrm e}^{2} \]

Solution by Mathematica

Time used: 0.023 (sec). Leaf size: 30

DSolve[{y'[x]==x^2+Exp[x]-Sin[x],{y[2]==-1}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \frac {x^3}{3}+e^x+\cos (x)-e^2-\frac {11}{3}-\cos (2) \]