4.16 problem Problem 3(b)

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

Internal problem ID [12323]
Internal file name [OUTPUT/10976_Monday_October_02_2023_02_47_40_AM_31494725/index.tex]

Book: APPLIED DIFFERENTIAL EQUATIONS The Primary Course by Vladimir A. Dobrushkin. CRC Press 2015
Section: Chapter 5.6 Laplace transform. Nonhomogeneous equations. Problems page 368
Problem number: Problem 3(b).
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 {y^{\prime }-2 y=4 t \left (\operatorname {Heaviside}\left (t \right )-\operatorname {Heaviside}\left (t -2\right )\right )} \] With initial conditions \begin {align*} [y \left (0\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(t)y &= q(t) \end {align*}

Where here \begin {align*} p(t) &=-2\\ q(t) &=4 t \operatorname {Heaviside}\left (t \right )-4 t \operatorname {Heaviside}\left (t -2\right ) \end {align*}

Hence the ode is \begin {align*} y^{\prime }-2 y = 4 t \operatorname {Heaviside}\left (t \right )-4 t \operatorname {Heaviside}\left (t -2\right ) \end {align*}

The domain of \(p(t)=-2\) is \[ \{-\infty

4.16.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*} s Y \left (s \right )-y \left (0\right )-2 Y \left (s \right ) = \frac {4-4 \,{\mathrm e}^{-2 s} \left (2 s +1\right )}{s^{2}}\tag {1} \end {align*}

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

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

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

Converting the above solution to piecewise it becomes \[ y = \left \{\begin {array}{cc} 2 \,{\mathrm e}^{2 t}-1-2 t & t \le 2 \\ 2 \,{\mathrm e}^{2 t}-5 \,{\mathrm e}^{2 t -4} & 2

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left \{\begin {array}{cc} 2 \,{\mathrm e}^{2 t}-1-2 t & t \le 2 \\ 2 \,{\mathrm e}^{2 t}-5 \,{\mathrm e}^{2 t -4} & 2

Verification of solutions

\[ y = \left \{\begin {array}{cc} 2 \,{\mathrm e}^{2 t}-1-2 t & t \le 2 \\ 2 \,{\mathrm e}^{2 t}-5 \,{\mathrm e}^{2 t -4} & 2

4.16.3 Maple step by step solution

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

dsolve([diff(y(t),t)-2*y(t)=4*t*(Heaviside(t)-Heaviside(t-2)),y(0) = 1],y(t), singsol=all)
 

\[ y \left (t \right ) = -5 \operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{2 t -4}+2 t \operatorname {Heaviside}\left (t -2\right )-2 t +2 \,{\mathrm e}^{2 t}-1+\operatorname {Heaviside}\left (t -2\right ) \]

Solution by Mathematica

Time used: 0.121 (sec). Leaf size: 47

DSolve[{y'[t]-2*y[t]==4*t*(UnitStep[t]-UnitStep[t-2]),{y[0]==1}},y[t],t,IncludeSingularSolutions -> True]
 

\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} e^{2 t} & t<0 \\ e^{2 t-4} \left (-5+2 e^4\right ) & t>2 \\ -2 t+2 e^{2 t}-1 & \text {True} \\ \end {array} \\ \end {array} \]