2.22 problem 22

Internal problem ID [4463]

Book: Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section: Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number: 22.
ODE order: 1.
ODE degree: 1.

CAS Maple gives this as type [_linear]

Solve \begin {gather*} \boxed {y^{\prime } \sin \relax (x )+\cos \relax (x ) y-x \sin \relax (x )=0} \end {gather*} With initial conditions \begin {align*} \left [y \left (\frac {\pi }{2}\right ) = 2\right ] \end {align*}

Solution by Maple

Time used: 0.031 (sec). Leaf size: 18

dsolve([sin(x)*diff(y(x),x)+y(x)*cos(x)=x*sin(x),y(1/2*Pi) = 2],y(x), singsol=all)
 

\[ y \relax (x ) = \frac {-x \cos \relax (x )+\sin \relax (x )+1}{\sin \relax (x )} \]

Solution by Mathematica

Time used: 0.093 (sec). Leaf size: 14

DSolve[{Sin[x]*y'[x]+y[x]*Cos[x]==x*Sin[x],{y[Pi/2]==2}},y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to -x \cot (x)+\csc (x)+1 \\ \end{align*}