60.1.3 problem 3

Internal problem ID [10017]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 3
Date solved : Wednesday, March 05, 2025 at 08:04:19 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }+a y-b \sin \left (c x \right )&=0 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 45
ode:=diff(y(x),x)+a*y(x)-b*sin(c*x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_{1} {\mathrm e}^{-a x} \left (a^{2}+c^{2}\right )+b \left (-c \cos \left (c x \right )+\sin \left (c x \right ) a \right )}{a^{2}+c^{2}} \]
Mathematica. Time used: 0.072 (sec). Leaf size: 35
ode=D[y[x],x] + a*y[x] - b*Sin[c*x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-a x} \left (\int _1^xb e^{a K[1]} \sin (c K[1])dK[1]+c_1\right ) \]
Sympy. Time used: 0.183 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
ode = Eq(a*y(x) - b*sin(c*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- a x} + \frac {a b \sin {\left (c x \right )}}{a^{2} + c^{2}} - \frac {b c \cos {\left (c x \right )}}{a^{2} + c^{2}} \]