31.2.4 problem 10.3.5

Internal problem ID [7689]
Book : Basic Training in Mathematics. By R. Shankar. Plenum Press. NY. 1995
Section : Chapter 10, Differential equations. Section 10.3, ODEs with variable Coefficients. First order. page 315
Problem number : 10.3.5
Date solved : Tuesday, September 30, 2025 at 04:55:59 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (1\right )&=2 \\ \end{align*}
Maple. Time used: 0.035 (sec). Leaf size: 16
ode:=x^2*diff(y(x),x)+2*x*y(x) = sinh(x); 
ic:=[y(1) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {\cosh \left (x \right )+2-\cosh \left (1\right )}{x^{2}} \]
Mathematica. Time used: 0.023 (sec). Leaf size: 21
ode=x^2*D[y[x],x]+2*x*y[x]==Sinh[x]; 
ic={y[1]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\int _1^x\sinh (K[1])dK[1]+2}{x^2} \end{align*}
Sympy. Time used: 0.287 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) + 2*x*y(x) - sinh(x),0) 
ics = {y(1): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\cosh {\left (x \right )} - \cosh {\left (1 \right )} + 2}{x^{2}} \]