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 : Sunday, March 30, 2025 at 03:30:30 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.001 (sec). Leaf size: 30
ode:=diff(y(x),x) = a+b*exp(k*x)+c*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {b \,{\mathrm e}^{k x}}{-c +k}-\frac {a}{c}+{\mathrm e}^{c x} c_1 \]
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} \]