32.6.24 problem Exercise 12.24, page 103

Internal problem ID [5889]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.24, page 103
Date solved : Tuesday, March 04, 2025 at 11:52:58 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 13
ode:=diff(y(x),x)+y(x)*cos(x) = exp(-sin(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (x +c_{1} \right ) {\mathrm e}^{-\sin \left (x \right )} \]
Mathematica. Time used: 0.134 (sec). Leaf size: 16
ode=D[y[x],x]+y[x]*Cos[x]==Exp[-Sin[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (x+c_1) e^{-\sin (x)} \]
Sympy. Time used: 0.879 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*cos(x) + Derivative(y(x), x) - exp(-sin(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x\right ) e^{- \sin {\left (x \right )}} \]