36.2.22 problem 22

Internal problem ID [6315]
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
Date solved : Monday, January 27, 2025 at 01:55:58 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (\frac {\pi }{2}\right )&=2 \end{align*}

Solution by Maple

Time used: 0.011 (sec). Leaf size: 13

dsolve([sin(x)*diff(y(x),x)+y(x)*cos(x)=x*sin(x),y(1/2*Pi) = 2],y(x), singsol=all)
 
\[ y \left (x \right ) = -\cot \left (x \right ) x +1+\csc \left (x \right ) \]

Solution by Mathematica

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

DSolve[{Sin[x]*D[y[x],x]+y[x]*Cos[x]==x*Sin[x],{y[Pi/2]==2}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to -x \cot (x)+\csc (x)+1 \]