86.3.7 problem 6 (i)

Internal problem ID [23098]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 4. Linear equations of the first order. Exercise 4a at page 56
Problem number : 6 (i)
Date solved : Thursday, October 02, 2025 at 09:20:09 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} z \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 11
ode:=diff(z(x),x)-z(x)*sin(x) = 1/exp(cos(x)); 
ic:=[z(0) = 0]; 
dsolve([ode,op(ic)],z(x), singsol=all);
 
\[ z = {\mathrm e}^{-\cos \left (x \right )} x \]
Mathematica. Time used: 0.047 (sec). Leaf size: 13
ode=D[z[x],x]-z[x]*Sin[x]==1/Exp[ Cos[x] ]; 
ic={z[0]==0}; 
DSolve[{ode,ic},z[x],x,IncludeSingularSolutions->True]
 
\begin{align*} z(x)&\to x e^{-\cos (x)} \end{align*}
Sympy. Time used: 0.644 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
z = Function("z") 
ode = Eq(-z(x)*sin(x) + Derivative(z(x), x) - exp(-cos(x)),0) 
ics = {z(0): 0} 
dsolve(ode,func=z(x),ics=ics)
 
\[ z{\left (x \right )} = x e^{- \cos {\left (x \right )}} \]