2.21 problem 21

Internal problem ID [4462]

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: 21.
ODE order: 1.
ODE degree: 1.

CAS Maple gives this as type [_linear]

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

Solution by Maple

Time used: 0.01 (sec). Leaf size: 16

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

\[ y \relax (x ) = \left (-\pi ^{2}+x^{2}\right ) \cos \relax (x ) \]

Solution by Mathematica

Time used: 0.078 (sec). Leaf size: 17

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

\begin{align*} y(x)\to \left (x^2-\pi ^2\right ) \cos (x) \\ \end{align*}