3.1 problem 1

3.1.1 Solving as linear ode
3.1.2 Maple step by step solution

Internal problem ID [4761]
Internal file name [OUTPUT/4254_Sunday_June_05_2022_12_48_26_PM_95796451/index.tex]

Book: Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section: Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number: 1.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[[_linear, `class A`]]

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

3.1.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) &=1\\ q(x) &={\mathrm e}^{x} \end {align*}

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

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

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

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

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

Summary

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

Figure 2: Slope field plot

Verification of solutions

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

3.1.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }+y={\mathrm e}^{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+{\mathrm e}^{x} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & y^{\prime }+y={\mathrm e}^{x} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+y\right )=\mu \left (x \right ) {\mathrm e}^{x} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (y \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+y\right )=y^{\prime } \mu \left (x \right )+y \mu ^{\prime }\left (x \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (x \right ) \\ {} & {} & \mu ^{\prime }\left (x \right )=\mu \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (y \mu \left (x \right )\right )\right )d x =\int \mu \left (x \right ) {\mathrm e}^{x}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \mu \left (x \right ) {\mathrm e}^{x}d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \mu \left (x \right ) {\mathrm e}^{x}d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{x} \\ {} & {} & y=\frac {\int \left ({\mathrm e}^{x}\right )^{2}d x +c_{1}}{{\mathrm e}^{x}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {\frac {\left ({\mathrm e}^{x}\right )^{2}}{2}+c_{1}}{{\mathrm e}^{x}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\frac {{\mathrm e}^{x}}{2}+c_{1} {\mathrm e}^{-x} \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: 15

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

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

Solution by Mathematica

Time used: 0.039 (sec). Leaf size: 21

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

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