44.1.28 problem 30

Internal problem ID [6903]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 1. Introduction to differential equations. Exercises 1.1 at page 12
Problem number : 30
Date solved : Sunday, March 30, 2025 at 11:27:51 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }+2 x y&=1 \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 22
ode:=diff(y(x),x)+2*x*y(x) = 1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\sqrt {\pi }\, \operatorname {erfi}\left (x \right )+2 c_1 \right ) {\mathrm e}^{-x^{2}}}{2} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 29
ode=D[y[x],x]+2*x*y[x]==1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} e^{-x^2} \left (\sqrt {\pi } \text {erfi}(x)+2 c_1\right ) \]
Sympy. Time used: 0.394 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \frac {\sqrt {\pi } \operatorname {erfi}{\left (x \right )}}{2}\right ) e^{- x^{2}} \]