29.2.3 problem 28

Internal problem ID [4636]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 2
Problem number : 28
Date solved : Tuesday, March 04, 2025 at 06:59:47 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }&=\cos \left (x \right )-y \tan \left (x \right ) \end{align*}

Maple. Time used: 0.000 (sec). Leaf size: 10
ode:=diff(y(x),x) = cos(x)-y(x)*tan(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (x +c_{1} \right ) \cos \left (x \right ) \]
Mathematica. Time used: 0.05 (sec). Leaf size: 12
ode=D[y[x],x]==Cos[x]-y[x]*Tan[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (x+c_1) \cos (x) \]
Sympy. Time used: 0.400 (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 )} \]