71.4.15 problem 15

Internal problem ID [14308]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.2, page 53
Problem number : 15
Date solved : Wednesday, March 05, 2025 at 10:45:10 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=a y+b \end{align*}

With initial conditions

\begin{align*} y \left (c \right )&=d \end{align*}

Maple. Time used: 0.029 (sec). Leaf size: 27
ode:=diff(y(x),x) = a*y(x)+b; 
ic:=y(c) = d; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (a d +b \right ) {\mathrm e}^{-a \left (-x +c \right )}-b}{a} \]
Mathematica. Time used: 0.038 (sec). Leaf size: 39
ode=D[y[x],x]==a*y[x]+b; 
ic={y[c]==d}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-a c} \left (b \left (e^{a x}-e^{a c}\right )+a d e^{a x}\right )}{a} \]
Sympy. Time used: 0.149 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*y(x) - b + Derivative(y(x), x),0) 
ics = {y(c): d} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (d e^{- a c} + \frac {b e^{- a c}}{a}\right ) e^{a x} - \frac {b}{a} \]