3.2 problem 1(b)

3.2.1 Solving as linear ode
3.2.2 Maple step by step solution

Internal problem ID [6158]
Internal file name [OUTPUT/5406_Sunday_June_05_2022_03_36_27_PM_50883306/index.tex]

Book: Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section: Chapter 1. What is a differential equation. Section 1.4 First Order Linear Equations. Page 15
Problem number: 1(b).
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[_separable]

\[ \boxed {y^{\prime }+y x=x} \]

3.2.1 Solving as linear ode

Entering Linear first order ODE solver. In canonical form a linear first order is \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}

Where here \begin {align*} p(x) &=x\\ q(x) &=x \end {align*}

Hence the ode is \begin {align*} y^{\prime }+y x = x \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int x d x} \\ &= {\mathrm e}^{\frac {x^{2}}{2}} \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (x\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left ({\mathrm e}^{\frac {x^{2}}{2}} y\right ) &= \left ({\mathrm e}^{\frac {x^{2}}{2}}\right ) \left (x\right )\\ \mathrm {d} \left ({\mathrm e}^{\frac {x^{2}}{2}} y\right ) &= \left (x \,{\mathrm e}^{\frac {x^{2}}{2}}\right )\, \mathrm {d} x \end {align*}

Integrating gives \begin {align*} {\mathrm e}^{\frac {x^{2}}{2}} y &= \int {x \,{\mathrm e}^{\frac {x^{2}}{2}}\,\mathrm {d} x}\\ {\mathrm e}^{\frac {x^{2}}{2}} y &= {\mathrm e}^{\frac {x^{2}}{2}} + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu ={\mathrm e}^{\frac {x^{2}}{2}}\) results in \begin {align*} y &= {\mathrm e}^{-\frac {x^{2}}{2}} {\mathrm e}^{\frac {x^{2}}{2}}+c_{1} {\mathrm e}^{-\frac {x^{2}}{2}} \end {align*}

which simplifies to \begin {align*} y &= 1+c_{1} {\mathrm e}^{-\frac {x^{2}}{2}} \end {align*}

Summary

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

Figure 60: Slope field plot

Verification of solutions

\[ y = 1+c_{1} {\mathrm e}^{-\frac {x^{2}}{2}} \] Verified OK.

3.2.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }+y x =x \\ \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 }=-y x +x \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {y^{\prime }}{y-1}=-x \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {y^{\prime }}{y-1}d x =\int -x d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \ln \left (y-1\right )=-\frac {x^{2}}{2}+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y={\mathrm e}^{-\frac {x^{2}}{2}+c_{1}}+1 \end {array} \]

Maple trace

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

Solution by Maple

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

dsolve(diff(y(x),x)+x*y(x)=x,y(x), singsol=all)
 

\[ y \left (x \right ) = 1+{\mathrm e}^{-\frac {x^{2}}{2}} c_{1} \]

Solution by Mathematica

Time used: 0.056 (sec). Leaf size: 24

DSolve[y'[x]+x*y[x]==x,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to 1+c_1 e^{-\frac {x^2}{2}} \\ y(x)\to 1 \\ \end{align*}