23.1.37 problem 32

Internal problem ID [4644]
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 : 32
Date solved : Tuesday, September 30, 2025 at 07:37:57 AM
CAS classification : [_linear]

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