23.1.7 problem 6

Internal problem ID [4614]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 6
Date solved : Tuesday, September 30, 2025 at 07:37:00 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=a \sin \left (b x +c \right )+k y \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 40
ode:=diff(y(x),x) = a*sin(b*x+c)+k*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{k x} c_1 -\frac {a \left (b \cos \left (b x +c \right )+\sin \left (b x +c \right ) k \right )}{b^{2}+k^{2}} \]
Mathematica. Time used: 0.076 (sec). Leaf size: 43
ode=D[y[x],x]==a*Sin[b*x+c]+k*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {a (k \sin (b x+c)+b \cos (b x+c))}{b^2+k^2}+c_1 e^{k x} \end{align*}
Sympy. Time used: 0.110 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
k = symbols("k") 
y = Function("y") 
ode = Eq(-a*sin(b*x + c) - k*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{k x} - \frac {a b \cos {\left (b x + c \right )}}{b^{2} + k^{2}} - \frac {a k \sin {\left (b x + c \right )}}{b^{2} + k^{2}} \]