44.3.19 problem 27

Internal problem ID [7000]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 1. Introduction to differential equations. Review problems at page 34
Problem number : 27
Date solved : Wednesday, March 05, 2025 at 04:01:54 AM
CAS classification : [_linear]

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

Maple. Time used: 0.000 (sec). Leaf size: 19
ode:=diff(y(x),x)+sin(x)*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\int x \,{\mathrm e}^{-\cos \left (x \right )}d x +c_{1} \right ) {\mathrm e}^{\cos \left (x \right )} \]
Mathematica. Time used: 0.679 (sec). Leaf size: 30
ode=D[y[x],x]+y[x]*Sin[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{\cos (x)} \left (\int _1^xe^{-\cos (K[1])} K[1]dK[1]+c_1\right ) \]
Sympy. Time used: 13.092 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + y(x)*sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int x e^{- \cos {\left (x \right )}}\, dx + \int y{\left (x \right )} e^{- \cos {\left (x \right )}} \sin {\left (x \right )}\, dx = C_{1} \]