90.26.2 problem 21 (a)

Internal problem ID [25403]
Book : Ordinary Differential Equations. By William Adkins and Mark G Davidson. Springer. NY. 2010. ISBN 978-1-4614-3617-1
Section : Chapter 6. Discontinuous Functions and the Laplace Transform. Exercises at page 379
Problem number : 21 (a)
Date solved : Friday, October 03, 2025 at 12:01:11 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }+2 y&=\left \{\begin {array}{cc} {\mathrm e}^{t} & 0\le t <1 \\ {\mathrm e}^{2 t} & 1\le t <\infty \end {array}\right . \end{align*}

Using Laplace method

Maple
ode:=diff(diff(y(t),t),t)-3*diff(y(t),t)+2*y(t) = piecewise(0 <= t and t < 1,exp(t),1 <= t and t < infinity,exp(2*t)); 
dsolve(ode,y(t),method='laplace');
 
\[ \text {No solution found} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 77
ode=D[y[t],{t,2}]-3*D[y[t],t]+2*y[t]==Piecewise[{{Exp[t],0<=t<1},{Exp[2*t],1<=t<Infinity}}]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to e^t \left (e^t \left ( \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ 1-e^{-t} & 0<t\leq 1 \\ t-\frac {1}{e} & \text {True} \\ \end {array} \\ \end {array} \right )+\left ( \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ -t & 0<t\leq 1 \\ -1+e-e^t & \text {True} \\ \end {array} \\ \end {array} \right )+c_2 e^t+c_1\right ) \end{align*}
Sympy. Time used: 1.407 (sec). Leaf size: 92
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((exp(t), (t >= 0) & (t < 1)), (exp(2*t), (t >= 1) & (t < oo))) + 2*y(t) - 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ \left [ y{\left (t \right )} = \begin {cases} \frac {C_{1} e^{\frac {2 t}{3}}}{e^{\frac {2 t}{3}} + 1} - \frac {e^{t}}{e^{\frac {2 t}{3}} + 1} & \text {for}\: t > 0 \wedge t < 1 \\\text {NaN} & \text {otherwise} \end {cases}, \ y{\left (t \right )} = \begin {cases} \frac {C_{1} e^{2 t}}{e^{\frac {4 t}{3} + \frac {2}{3}} + e^{2 t - \frac {2}{3}}} - \frac {e^{\frac {10 t}{3}}}{4 e^{\frac {4 t}{3} + \frac {2}{3}} + 4 e^{2 t - \frac {2}{3}}} & \text {for}\: t > 1 \\\text {NaN} & \text {otherwise} \end {cases}\right ] \]