75.3.7 problem 7

Internal problem ID [19911]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter III. Ordinary differential equations of the first order and first degree. Exercises at page 33
Problem number : 7
Date solved : Thursday, October 02, 2025 at 05:00:53 PM
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.002 (sec). Leaf size: 15
ode:=diff(y(x),x)+cos(x)*y(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.03 (sec). Leaf size: 18
ode=D[y[x],x]+Cos[x]*y[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.266 (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 \]