14.7 problem Problem 33

14.7.1 Existence and uniqueness analysis
14.7.2 Solving as laplace ode
14.7.3 Maple step by step solution

Internal problem ID [2873]
Internal file name [OUTPUT/2365_Sunday_June_05_2022_03_01_07_AM_93783359/index.tex]

Book: Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section: Chapter 10, The Laplace Transform and Some Elementary Applications. Exercises for 10.7. page 704
Problem number: Problem 33.
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 }-3 y=-10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right )} \] With initial conditions \begin {align*} [y \left (0\right ) = 5] \end {align*}

14.7.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) &=-3\\ q(t) &=-10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right ) \end {align*}

Hence the ode is \begin {align*} y^{\prime }-3 y = -10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right ) \end {align*}

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

14.7.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 )-3 Y \left (s \right ) = 10 \operatorname {laplace} \left (-{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right ), t , s\right )\tag {1} \end {align*}

Replacing initial condition gives \begin {align*} s Y \left (s \right )-5-3 Y \left (s \right ) = 10 \operatorname {laplace} \left (-{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right ), t , s\right ) \end {align*}

Solving for \(Y(s)\) gives \begin {align*} Y(s) = \frac {10 \operatorname {laplace} \left (-{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \operatorname {Heaviside}\left (t -a \right ), t , s\right )+5}{s -3} \end {align*}

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

Converting the above solution to piecewise it becomes \[ y = \left \{\begin {array}{cc} 5 \,{\mathrm e}^{3 t}+\operatorname {Heaviside}\left (-a \right ) \left (-{\mathrm e}^{-3 a +3 t}+{\mathrm e}^{a +3 t} \left (\cos \left (2 a \right )-2 \sin \left (2 a \right )\right )\right ) & t

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left \{\begin {array}{cc} 5 \,{\mathrm e}^{3 t}+\operatorname {Heaviside}\left (-a \right ) \left (-{\mathrm e}^{-3 a +3 t}+{\mathrm e}^{a +3 t} \left (\cos \left (2 a \right )-2 \sin \left (2 a \right )\right )\right ) & t

Verification of solutions

\[ y = \left \{\begin {array}{cc} 5 \,{\mathrm e}^{3 t}+\operatorname {Heaviside}\left (-a \right ) \left (-{\mathrm e}^{-3 a +3 t}+{\mathrm e}^{a +3 t} \left (\cos \left (2 a \right )-2 \sin \left (2 a \right )\right )\right ) & t

14.7.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }-3 y=-10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \right ), y \left (0\right )=5\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-10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \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 }-3 y=-10 \,{\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \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 }-3 y\right )=-10 \mu \left (t \right ) {\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \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 }-3 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 )=-3 \mu \left (t \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (t \right )={\mathrm e}^{-3 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 -10 \mu \left (t \right ) {\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \right )d t +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (t \right )=\int -10 \mu \left (t \right ) {\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \right )d t +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int -10 \mu \left (t \right ) {\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \right )d t +c_{1}}{\mu \left (t \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (t \right )={\mathrm e}^{-3 t} \\ {} & {} & y=\frac {\int -10 \,{\mathrm e}^{-3 t} {\mathrm e}^{-t +a} \sin \left (-2 t +2 a \right ) \mathit {Heaviside}\left (t -a \right )d t +c_{1}}{{\mathrm e}^{-3 t}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {10 \left (\frac {{\mathrm e}^{a} \cos \left (a \right )^{2} {\mathrm e}^{-4 t} \left (-4 \sin \left (2 t \right )-2 \cos \left (2 t \right )\right )}{10}-\frac {{\mathrm e}^{a} {\mathrm e}^{-4 t} \left (-4 \sin \left (2 t \right )-2 \cos \left (2 t \right )\right )}{20}-4 \,{\mathrm e}^{a} \cos \left (a \right ) \sin \left (a \right ) \left (\frac {\left (-4 \cos \left (t \right )+2 \sin \left (t \right )\right ) {\mathrm e}^{-4 t} \cos \left (t \right )}{20}-\frac {1}{40 \left ({\mathrm e}^{t}\right )^{4}}\right )-\frac {{\mathrm e}^{a} \sin \left (a \right ) \cos \left (a \right )}{2 \left ({\mathrm e}^{t}\right )^{4}}\right ) \mathit {Heaviside}\left (t -a \right )+10 \mathit {Heaviside}\left (t -a \right ) \left (-\frac {{\mathrm e}^{a} \cos \left (a \right )^{2} {\mathrm e}^{-4 a} \left (-4 \sin \left (2 a \right )-2 \cos \left (2 a \right )\right )}{10}+\frac {{\mathrm e}^{a} {\mathrm e}^{-4 a} \left (-4 \sin \left (2 a \right )-2 \cos \left (2 a \right )\right )}{20}+4 \,{\mathrm e}^{a} \cos \left (a \right ) \sin \left (a \right ) \left (\frac {\left (-4 \cos \left (a \right )+2 \sin \left (a \right )\right ) {\mathrm e}^{-4 a} \cos \left (a \right )}{20}-\frac {1}{40 \left ({\mathrm e}^{a}\right )^{4}}\right )+\frac {\sin \left (a \right ) \cos \left (a \right )}{2 \left ({\mathrm e}^{a}\right )^{3}}\right )+c_{1}}{{\mathrm e}^{-3 t}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\left (c_{1} {\mathrm e}^{3 a +4 t}-4 \mathit {Heaviside}\left (t -a \right ) \left (\left (\frac {1}{4}+\left (\cos \left (t \right )^{2}+2 \sin \left (t \right ) \cos \left (t \right )-\frac {1}{2}\right ) \cos \left (a \right )^{2}+\sin \left (a \right ) \left (\sin \left (t \right ) \cos \left (t \right )-2 \cos \left (t \right )^{2}+1\right ) \cos \left (a \right )-\frac {\cos \left (t \right )^{2}}{2}-\sin \left (t \right ) \cos \left (t \right )\right ) {\mathrm e}^{4 a}-\frac {{\mathrm e}^{4 t}}{4}\right )\right ) {\mathrm e}^{-3 a -t} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=5 \\ {} & {} & 5=\left (c_{1} {\mathrm e}^{3 a}-4 \mathit {Heaviside}\left (-a \right ) \left (\left (-\frac {1}{4}+\frac {\cos \left (a \right )^{2}}{2}-\sin \left (a \right ) \cos \left (a \right )\right ) {\mathrm e}^{4 a}-\frac {1}{4}\right )\right ) {\mathrm e}^{-3 a} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =\frac {2 \cos \left (a \right )^{2} {\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-4 \cos \left (a \right ) \sin \left (a \right ) {\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-{\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-{\mathrm e}^{-3 a} \mathit {Heaviside}\left (-a \right )+5}{{\mathrm e}^{3 a} {\mathrm e}^{-3 a}} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =\frac {2 \cos \left (a \right )^{2} {\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-4 \cos \left (a \right ) \sin \left (a \right ) {\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-{\mathrm e}^{4 a} \mathit {Heaviside}\left (-a \right ) {\mathrm e}^{-3 a}-{\mathrm e}^{-3 a} \mathit {Heaviside}\left (-a \right )+5}{{\mathrm e}^{3 a} {\mathrm e}^{-3 a}}\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y={\mathrm e}^{-6 a -t} \left (-2 \left (\cos \left (a \right )^{2}-2 \sin \left (a \right ) \cos \left (a \right )-\frac {1}{2}\right ) \left (\mathit {Heaviside}\left (a \right )-1\right ) {\mathrm e}^{7 a +4 t}+\left (\mathit {Heaviside}\left (t -a \right )+\mathit {Heaviside}\left (a \right )-1\right ) {\mathrm e}^{3 a +4 t}+5 \,{\mathrm e}^{6 a +4 t}+\left (-1+2 \left (-2 \cos \left (t \right )^{2}-4 \sin \left (t \right ) \cos \left (t \right )+1\right ) \cos \left (a \right )^{2}+4 \sin \left (a \right ) \left (2 \cos \left (t \right )^{2}-\sin \left (t \right ) \cos \left (t \right )-1\right ) \cos \left (a \right )+2 \cos \left (t \right )^{2}+4 \sin \left (t \right ) \cos \left (t \right )\right ) {\mathrm e}^{7 a} \mathit {Heaviside}\left (t -a \right )\right ) \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y={\mathrm e}^{-6 a -t} \left (-2 \left (\cos \left (a \right )^{2}-2 \sin \left (a \right ) \cos \left (a \right )-\frac {1}{2}\right ) \left (\mathit {Heaviside}\left (a \right )-1\right ) {\mathrm e}^{7 a +4 t}+\left (\mathit {Heaviside}\left (t -a \right )+\mathit {Heaviside}\left (a \right )-1\right ) {\mathrm e}^{3 a +4 t}+5 \,{\mathrm e}^{6 a +4 t}+\left (-1+2 \left (-2 \cos \left (t \right )^{2}-4 \sin \left (t \right ) \cos \left (t \right )+1\right ) \cos \left (a \right )^{2}+4 \sin \left (a \right ) \left (2 \cos \left (t \right )^{2}-\sin \left (t \right ) \cos \left (t \right )-1\right ) \cos \left (a \right )+2 \cos \left (t \right )^{2}+4 \sin \left (t \right ) \cos \left (t \right )\right ) {\mathrm e}^{7 a} \mathit {Heaviside}\left (t -a \right )\right ) \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: 3.907 (sec). Leaf size: 97

dsolve([diff(y(t),t)-3*y(t)=10*exp(-(t-a))*sin(2*(t-a))*Heaviside(t-a),y(0) = 5],y(t), singsol=all)
 

\[ y \left (t \right ) = \left (\operatorname {Heaviside}\left (t -a \right )+\operatorname {Heaviside}\left (a \right )-1\right ) {\mathrm e}^{-3 a +3 t}-\left (\left (\cos \left (2 t \right )+2 \sin \left (2 t \right )\right ) \cos \left (2 a \right )-2 \sin \left (2 a \right ) \left (\cos \left (2 t \right )-\frac {\sin \left (2 t \right )}{2}\right )\right ) {\mathrm e}^{-t +a} \operatorname {Heaviside}\left (t -a \right )-\left (\operatorname {Heaviside}\left (a \right )-1\right ) \left (\cos \left (2 a \right )-2 \sin \left (2 a \right )\right ) {\mathrm e}^{3 t +a}+5 \,{\mathrm e}^{3 t} \]

Solution by Mathematica

Time used: 0.461 (sec). Leaf size: 103

DSolve[{y'[t]-3*y[t]==10*Exp[-(t-a)]*Sin[2*(t-a)]*UnitStep[t-a],{y[0]==5}},y[t],t,IncludeSingularSolutions -> True]
 

\[ y(t)\to e^{-3 a-t} \left (e^{4 t} \theta (-a) \left (-2 e^{4 a} \sin (2 a)+e^{4 a} \cos (2 a)-1\right )+\theta (t-a) \left (2 e^{4 a} \sin (2 (a-t))-e^{4 a} \cos (2 (a-t))+e^{4 t}\right )+5 e^{3 a+4 t}\right ) \]