16.2 problem 2

16.2.1 Existence and uniqueness analysis
16.2.2 Solving as laplace ode
16.2.3 Maple step by step solution

Internal problem ID [12814]
Internal file name [OUTPUT/11467_Saturday_November_04_2023_08_47_29_AM_86585364/index.tex]

Book: Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section: Chapter 5. The Laplace Transform Method. Exercises 5.5, page 273
Problem number: 2.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "exact", "linear", "first_order_ode_lie_symmetry_lookup"

Maple gives the following as the ode type

[[_linear, `class A`]]

\[ \boxed {-3 y+y^{\prime }=\delta \left (x -1\right )+2 \operatorname {Heaviside}\left (x -2\right )} \] With initial conditions \begin {align*} [y \left (0\right ) = 0] \end {align*}

16.2.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) &=-3\\ q(x) &=\delta \left (x -1\right )+2 \operatorname {Heaviside}\left (x -2\right ) \end {align*}

Hence the ode is \begin {align*} -3 y+y^{\prime } = \delta \left (x -1\right )+2 \operatorname {Heaviside}\left (x -2\right ) \end {align*}

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

16.2.2 Solving as laplace ode

Solving using the Laplace transform method. Let \[ \mathcal {L}\left (y\right ) =Y(s) \] Taking the Laplace transform of the ode and using the relations that \begin {align*} \mathcal {L}\left (y^{\prime }\right )&= s Y(s) - y \left (0\right ) \end {align*}

The given ode now becomes an algebraic equation in the Laplace domain \begin {align*} -3 Y \left (s \right )+s Y \left (s \right )-y \left (0\right ) = {\mathrm e}^{-s}+\frac {2 \,{\mathrm e}^{-2 s}}{s}\tag {1} \end {align*}

Replacing initial condition gives \begin {align*} -3 Y \left (s \right )+s Y \left (s \right ) = {\mathrm e}^{-s}+\frac {2 \,{\mathrm e}^{-2 s}}{s} \end {align*}

Solving for \(Y(s)\) gives \begin {align*} Y(s) = \frac {{\mathrm e}^{-s} s +2 \,{\mathrm e}^{-2 s}}{s \left (s -3\right )} \end {align*}

Taking the inverse Laplace transform gives \begin {align*} y&= \mathcal {L}^{-1}\left (Y(s)\right )\\ &= \mathcal {L}^{-1}\left (\frac {{\mathrm e}^{-s} s +2 \,{\mathrm e}^{-2 s}}{s \left (s -3\right )}\right )\\ &= -\frac {2 \operatorname {Heaviside}\left (x -2\right )}{3}+\frac {2 \left (1-\operatorname {Heaviside}\left (2-x \right )\right ) {\mathrm e}^{3 x -6}}{3}+{\mathrm e}^{3 x -3} \left (1-\operatorname {Heaviside}\left (1-x \right )\right ) \end {align*}

Converting the above solution to piecewise it becomes \[ y = \left \{\begin {array}{cc} 0 & x \le 1 \\ {\mathrm e}^{3 x -3} & x <2 \\ -\frac {2}{3}+{\mathrm e}^{3} & x =2 \\ -\frac {2}{3}+\frac {2 \,{\mathrm e}^{3 x -6}}{3}+{\mathrm e}^{3 x -3} & 2

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left \{\begin {array}{cc} 0 & x \le 1 \\ {\mathrm e}^{3 x -3} & x <2 \\ -\frac {2}{3}+{\mathrm e}^{3} & x &=2 \\ -\frac {2}{3}+\frac {2 \,{\mathrm e}^{3 x -6}}{3}+{\mathrm e}^{3 x -3} & 2

Verification of solutions

\[ y = \left \{\begin {array}{cc} 0 & x \le 1 \\ {\mathrm e}^{3 x -3} & x <2 \\ -\frac {2}{3}+{\mathrm e}^{3} & x =2 \\ -\frac {2}{3}+\frac {2 \,{\mathrm e}^{3 x -6}}{3}+{\mathrm e}^{3 x -3} & 2

16.2.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [-3 y+y^{\prime }=\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right ), y \left (0\right )=0\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 }=3 y+\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right ) \\ \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} \\ {} & {} & -3 y+y^{\prime }=\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (-3 y+y^{\prime }\right )=\mu \left (x \right ) \left (\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right )\right ) \\ \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 (-3 y+y^{\prime }\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 )=-3 \mu \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{-3 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 ) \left (\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right )\right )d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \mu \left (x \right ) \left (\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right )\right )d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \mu \left (x \right ) \left (\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right )\right )d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{-3 x} \\ {} & {} & y=\frac {\int {\mathrm e}^{-3 x} \left (\mathit {Dirac}\left (x -1\right )+2 \mathit {Heaviside}\left (x -2\right )\right )d x +c_{1}}{{\mathrm e}^{-3 x}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {{\mathrm e}^{-3} \mathit {Heaviside}\left (x -1\right )-\frac {2 \,{\mathrm e}^{-3 x} \mathit {Heaviside}\left (x -2\right )}{3}+\frac {2 \mathit {Heaviside}\left (x -2\right ) {\mathrm e}^{-6}}{3}+c_{1}}{{\mathrm e}^{-3 x}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y={\mathrm e}^{3 x -3} \mathit {Heaviside}\left (x -1\right )-\frac {2 \mathit {Heaviside}\left (x -2\right )}{3}+\frac {2 \,{\mathrm e}^{3 x -6} \mathit {Heaviside}\left (x -2\right )}{3}+c_{1} {\mathrm e}^{3 x} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=0 \\ {} & {} & 0=c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y={\mathrm e}^{3 x -3} \mathit {Heaviside}\left (x -1\right )-\frac {2 \mathit {Heaviside}\left (x -2\right )}{3}+\frac {2 \,{\mathrm e}^{3 x -6} \mathit {Heaviside}\left (x -2\right )}{3} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y={\mathrm e}^{3 x -3} \mathit {Heaviside}\left (x -1\right )-\frac {2 \mathit {Heaviside}\left (x -2\right )}{3}+\frac {2 \,{\mathrm e}^{3 x -6} \mathit {Heaviside}\left (x -2\right )}{3} \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: 6.234 (sec). Leaf size: 46

dsolve([diff(y(x),x)-3*y(x)=Dirac(x-1)+2*Heaviside(x-2),y(0) = 0],y(x), singsol=all)
 

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

Solution by Mathematica

Time used: 0.212 (sec). Leaf size: 44

DSolve[{y'[x]-3*y[x]==DiracDelta[x-1]+2*UnitStep[x-2],{y[0]==0}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to e^{3 x-3} \theta (x-1)+\frac {2 \left (e^6-e^{3 x}\right ) (\theta (2-x)-1)}{3 e^6} \]