23.1.4 problem 3 (b)

Internal problem ID [4611]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 3 (b)
Date solved : Tuesday, September 30, 2025 at 07:36:55 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=x^{2}+3 \cosh \left (x \right )-2 y \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 56
ode:=diff(y(x),x) = x^2+3*cosh(x)-2*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-2 x} \left (\left (x^{2}+\frac {1}{2}-x \right ) \cosh \left (2 x \right )+\left (x^{2}+\frac {1}{2}-x \right ) \sinh \left (2 x \right )+2 c_1 +3 \cosh \left (x \right )+3 \sinh \left (x \right )+\cosh \left (3 x \right )+\sinh \left (3 x \right )\right )}{2} \]
Mathematica. Time used: 0.045 (sec). Leaf size: 40
ode=D[y[x],x]==x^2+3*Cosh[x]-2*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} \left (2 x^2-2 x+6 e^{-x}+2 e^x+4 c_1 e^{-2 x}+1\right ) \end{align*}
Sympy. Time used: 0.099 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + 2*y(x) - 3*cosh(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + \frac {x^{2}}{2} - \frac {x}{2} - \sinh {\left (x \right )} + 2 \cosh {\left (x \right )} + \frac {1}{4} \]