85.33.70 problem 71

Internal problem ID [22693]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 65
Problem number : 71
Date solved : Thursday, October 02, 2025 at 09:10:48 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} r^{\prime }&={\mathrm e}^{t}-3 r \end{align*}

With initial conditions

\begin{align*} r \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.010 (sec). Leaf size: 15
ode:=diff(r(t),t) = exp(t)-3*r(t); 
ic:=[r(0) = 1]; 
dsolve([ode,op(ic)],r(t), singsol=all);
 
\[ r = \frac {{\mathrm e}^{t}}{4}+\frac {3 \,{\mathrm e}^{-3 t}}{4} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 21
ode=D[r[t],{t,1}]==Exp[t]-3*r[t]; 
ic={r[0]==1}; 
DSolve[{ode,ic},r[t],t,IncludeSingularSolutions->True]
 
\begin{align*} r(t)&\to \frac {1}{4} e^{-3 t} \left (e^{4 t}+3\right ) \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
r = Function("r") 
ode = Eq(3*r(t) - exp(t) + Derivative(y(x), x),0) 
ics = {r(0): 1} 
dsolve(ode,func=r(t),ics=ics)
 
ValueError : Couldnt solve for initial conditions