5.9 problem 9

Internal problem ID [5076]

Book: Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section: Chapter 2. Linear homogeneous equations. Section 2.3.4 problems. page 104
Problem number: 9.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {x y^{\prime \prime }+2 y^{\prime }+x y-\sec \left (x \right )=0} \]

Solution by Maple

Time used: 0.015 (sec). Leaf size: 35

dsolve(x*diff(y(x),x$2)+2*diff(y(x),x)+x*y(x)=sec(x),y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {\sin \left (x \right ) c_{2}}{x}+\frac {\cos \left (x \right ) c_{1}}{x}+\frac {-\ln \left (\sec \left (x \right )\right ) \cos \left (x \right )+\sin \left (x \right ) x}{x} \]

Solution by Mathematica

Time used: 0.033 (sec). Leaf size: 59

DSolve[x*y''[x]+2*y'[x]+x*y[x]==Sec[x],y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to \frac {e^{-i x} \left (\log \left (1+e^{2 i x}\right )+e^{2 i x} \left (\log \left (1+e^{-2 i x}\right )-i c_2\right )+2 c_1\right )}{2 x} \\ \end{align*}