23.1.34 problem 29

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

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