20.10.2 problem Problem 15

Internal problem ID [3774]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.8, A Differential Equation with Nonconstant Coefficients. page 567
Problem number : Problem 15
Date solved : Monday, January 27, 2025 at 08:01:18 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

Solution by Maple

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

dsolve(x^2*diff(y(x),x$2)+4*x*diff(y(x),x)+2*y(x)=cos(x),y(x), singsol=all)
 
\[ y \left (x \right ) = \frac {c_{2} +c_{1} x -\cos \left (x \right )}{x^{2}} \]

Solution by Mathematica

Time used: 0.022 (sec). Leaf size: 20

DSolve[x^2*D[y[x],{x,2}]+4*x*D[y[x],x]+2*y[x]==Cos[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {-\cos (x)+c_2 x+c_1}{x^2} \]