2.4.2 Problem 28-2

2.4.2.1 Maple
2.4.2.2 Mathematica
2.4.2.3 Sympy

Internal problem ID [21704]
Book : The Differential Equations Problem Solver. VOL. II. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 28. Laplace transforms. Page 850
Problem number : 28-2
Date solved : Thursday, December 11, 2025 at 11:37:47 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }-5 y&=0 \\ y \left (\pi \right ) &= 2 \\ \end{align*}
Using Laplace transform method.

Entering first order ode laplace constant coeff solverSince initial condition is not at zero, then let

\begin{align*} y \left (0\right ) = c_1 \end{align*}

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 )-5 Y \left (s \right ) = 0\tag {1} \end{align*}

Replacing initial condition gives

\begin{align*} s Y \left (s \right )-c_1 -5 Y \left (s \right ) = 0 \end{align*}

Solving for \(Y(s)\) gives

\begin{align*} Y(s) = \frac {c_1}{s -5} \end{align*}

Taking the inverse Laplace transform gives

\begin{align*} y&= \mathcal {L}^{-1}\left (Y(s)\right )\\ &= \mathcal {L}^{-1}\left (\frac {c_1}{s -5}\right )\\ &= c_1 \,{\mathrm e}^{5 t} \end{align*}

The constant \(c_1\) is determined from the given initial condition \(y(\pi )=2\) using the solution found above. This results in

\begin{align*} 2&=c_1 \,{\mathrm e}^{5 \pi } \end{align*}

Solving gives

\begin{align*} c_1 &=2 \,{\mathrm e}^{-5 \pi } \end{align*}

Hence the solution now becomes

\begin{align*} y&=2 \,{\mathrm e}^{-5 \pi } {\mathrm e}^{5 t} \end{align*}
Solution plot Slope field \(y^{\prime }-5 y = 0\)
2.4.2.1 Maple. Time used: 0.057 (sec). Leaf size: 14
ode:=diff(y(t),t)-5*y(t) = 0; 
ic:=[y(Pi) = 2]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = 2 \,{\mathrm e}^{5 t -5 \pi } \]

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d t}y \left (t \right )-5 y \left (t \right )=0, y \left (\pi \right )=2\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d t}y \left (t \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d t}y \left (t \right )=5 y \left (t \right ) \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {\frac {d}{d t}y \left (t \right )}{y \left (t \right )}=5 \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \frac {\frac {d}{d t}y \left (t \right )}{y \left (t \right )}d t =\int 5d t +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \ln \left (y \left (t \right )\right )=5 t +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (t \right ) \\ {} & {} & y \left (t \right )={\mathrm e}^{5 t +\mathit {C1}} \\ \bullet & {} & \textrm {Redefine the integration constant(s)}\hspace {3pt} \\ {} & {} & y \left (t \right )=\mathit {C1} \,{\mathrm e}^{5 t} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (\pi \right )=2 \\ {} & {} & 2=\mathit {C1} \,{\mathrm e}^{5 \pi } \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =\frac {2}{{\mathrm e}^{5 \pi }} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_C1} =\frac {2}{{\mathrm e}^{5 \pi }}\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y \left (t \right )=2 \,{\mathrm e}^{-5 \pi +5 t} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y \left (t \right )=2 \,{\mathrm e}^{-5 \pi +5 t} \end {array} \]
2.4.2.2 Mathematica. Time used: 0.014 (sec). Leaf size: 16
ode=D[y[t],t]-5*y[t]==0; 
ic={y[Pi]==2}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to 2 e^{5 t-5 \pi } \end{align*}
2.4.2.3 Sympy. Time used: 0.066 (sec). Leaf size: 14
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-5*y(t) + Derivative(y(t), t),0) 
ics = {y(pi): 2} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \frac {2 e^{5 t}}{e^{5 \pi }} \]