69.6.10 problem 134

Internal problem ID [18053]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 6. Linear equations of the first order. The Bernoulli equation. Exercises page 54
Problem number : 134
Date solved : Thursday, October 02, 2025 at 02:36:17 PM
CAS classification : [_separable]

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

With initial conditions

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