29.1.7 problem 6

Internal problem ID [4614]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 1
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 06:56:40 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=a +b \,{\mathrm e}^{k x}+c y \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 44
ode:=diff(y(x),x) = a+b*exp(k*x)+c*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {c_{1} c \left (c -k \right ) {\mathrm e}^{c x}-b \,{\mathrm e}^{k x} c -a \left (c -k \right )}{c \left (c -k \right )} \]
Mathematica. Time used: 0.251 (sec). Leaf size: 47
ode=D[y[x],x]==a+b*Exp[k*x]+c*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {a (k-c)-b c e^{k x}+c c_1 (c-k) e^{c x}}{c (c-k)} \]
Sympy. Time used: 0.153 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
k = symbols("k") 
y = Function("y") 
ode = Eq(-a - b*exp(k*x) - c*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{c x} - \frac {a}{c} - \frac {b e^{k x}}{c - k} \]