75.6.10 problem 134

Internal problem ID [16687]
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, March 13, 2025 at 08:31:44 AM
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.004 (sec). Leaf size: 5
ode:=diff(y(x),x)+y(x)*cos(x) = cos(x); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = 1 \]
Mathematica. Time used: 0.002 (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]
 
\[ y(x)\to 1 \]
Sympy. Time used: 0.257 (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 \]