87.3.5 problem 5

Internal problem ID [23254]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 26
Problem number : 5
Date solved : Thursday, October 02, 2025 at 09:27:09 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+y x&=3 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 30
ode:=diff(y(x),x)+x*y(x) = 3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-\frac {3 i \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {i \sqrt {2}\, x}{2}\right )}{2}+c_1 \right ) {\mathrm e}^{-\frac {x^{2}}{2}} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 40
ode=D[y[x],x]+x*y[x]==3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} e^{-\frac {x^2}{2}} \left (3 \sqrt {2 \pi } \text {erfi}\left (\frac {x}{\sqrt {2}}\right )+2 c_1\right ) \end{align*}
Sympy. Time used: 0.239 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x) + Derivative(y(x), x) - 3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \frac {3 \sqrt {2} \sqrt {\pi } \operatorname {erfi}{\left (\frac {\sqrt {2} x}{2} \right )}}{2}\right ) e^{- \frac {x^{2}}{2}} \]