67.4.27 problem 5.4 (a)

Internal problem ID [16396]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 5. LINEAR FIRST ORDER EQUATIONS. Additional exercises. page 103
Problem number : 5.4 (a)
Date solved : Thursday, October 02, 2025 at 01:27:39 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (0\right )&=4 \\ \end{align*}
Maple. Time used: 0.093 (sec). Leaf size: 54
ode:=diff(y(x),x)+6*x*y(x) = sin(x); 
ic:=[y(0) = 4]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{-3 x^{2}} \left (-48+\sqrt {\pi }\, \sqrt {3}\, \left (2 \,\operatorname {erf}\left (\frac {\sqrt {3}}{6}\right )+\operatorname {erf}\left (\frac {\sqrt {3}\, \left (6 i x -1\right )}{6}\right )+\operatorname {erf}\left (\frac {\left (-6 i x -1\right ) \sqrt {3}}{6}\right )\right ) {\mathrm e}^{\frac {1}{12}}\right )}{12} \]
Mathematica. Time used: 0.045 (sec). Leaf size: 34
ode=D[y[x],x]+6*x*y[x]==Sin[x]; 
ic={y[0]==4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-3 x^2} \left (\int _0^xe^{3 K[1]^2} \sin (K[1])dK[1]+4\right ) \end{align*}
Sympy. Time used: 5.522 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(6*x*y(x) - sin(x) + Derivative(y(x), x),0) 
ics = {y(0): 4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \int \left (6 x y{\left (x \right )} - \sin {\left (x \right )}\right ) e^{3 x^{2}}\, dx = \int \limits ^{0} \left (- e^{3 x^{2}} \sin {\left (x \right )}\right )\, dx + \int \limits ^{0} 6 x y{\left (x \right )} e^{3 x^{2}}\, dx \]