17.1.26 problem 2(p)

Internal problem ID [4116]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(p)
Date solved : Tuesday, September 30, 2025 at 07:05:40 AM
CAS classification : [_linear]

\begin{align*} y^{\prime } \cos \left (x \right )+y \sin \left (x \right )&=1 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.024 (sec). Leaf size: 6
ode:=diff(y(x),x)*cos(x)+y(x)*sin(x) = 1; 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \sin \left (x \right ) \]
Mathematica. Time used: 0.023 (sec). Leaf size: 7
ode=D[y[x],x]*Cos[x]+y[x]*Sin[x]==1; 
ic=y[0]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin (x) \end{align*}
Sympy. Time used: 0.422 (sec). Leaf size: 5
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*sin(x) + cos(x)*Derivative(y(x), x) - 1,0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \sin {\left (x \right )} \]