56.12.17 problem Ex 18

Internal problem ID [14144]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 19. Summary. Page 29
Problem number : Ex 18
Date solved : Thursday, October 02, 2025 at 09:17:05 AM
CAS classification : [_linear]

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