29.2.4 problem 29

Internal problem ID [4637]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 2
Problem number : 29
Date solved : Sunday, March 30, 2025 at 03:31:51 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 11
ode:=diff(y(x),x) = sec(x)-y(x)*tan(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \cos \left (x \right ) c_1 +\sin \left (x \right ) \]
Mathematica. Time used: 0.04 (sec). Leaf size: 13
ode=D[y[x],x]==Sec[x]-y[x]*Tan[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sin (x)+c_1 \cos (x) \]
Sympy. Time used: 0.625 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*tan(x) + Derivative(y(x), x) - 1/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \cos {\left (x \right )} + \sin {\left (x \right )} \]