89.6.8 problem 8

Internal problem ID [24391]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Miscellaneous Exercises at page 45
Problem number : 8
Date solved : Thursday, October 02, 2025 at 10:24:17 PM
CAS classification : [_linear]

\begin{align*} \cos \left (x \right ) y^{\prime }&=1-y-\sin \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=cos(x)*diff(y(x),x) = 1-y(x)-sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x +c_1}{\sec \left (x \right )+\tan \left (x \right )} \]
Mathematica. Time used: 0.175 (sec). Leaf size: 39
ode=Cos[x]*D[y[x],x] - Cos[x]== 1-y[x]-Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-2 \text {arctanh}\left (\tan \left (\frac {x}{2}\right )\right )} \left (x-2 \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+c_1\right ) \end{align*}
Sympy. Time used: 41.583 (sec). Leaf size: 82
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + sin(x) + cos(x)*Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\left (C_{1} + \int \frac {\sqrt {\sin {\left (x \right )} + 1} \left (y{\left (x \right )} + \sin {\left (x \right )} - 1\right )}{\sqrt {\sin {\left (x \right )} - 1} \cos {\left (x \right )}}\, dx\right ) \sqrt {\sin {\left (x \right )} - 1}}{\sqrt {\sin {\left (x \right )} - 1} \int \frac {\sqrt {\sin {\left (x \right )} + 1}}{\sqrt {\sin {\left (x \right )} - 1} \cos {\left (x \right )}}\, dx - \sqrt {\sin {\left (x \right )} + 1}} \]