30.6.15 problem 16

Internal problem ID [7550]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 16
Date solved : Tuesday, September 30, 2025 at 04:47:12 PM
CAS classification : [_linear]

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