29.3.12 problem 12

Internal problem ID [7251]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number : 12
Date solved : Tuesday, September 30, 2025 at 04:26:13 PM
CAS classification : [_linear]

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