38.3.20 problem 28

Internal problem ID [8287]
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. Review problems at page 34
Problem number : 28
Date solved : Tuesday, September 30, 2025 at 05:21:42 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }-2 x y&={\mathrm e}^{x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=diff(y(x),x)-2*x*y(x) = exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\sqrt {\pi }\, {\mathrm e}^{\frac {1}{4}} \operatorname {erf}\left (x -\frac {1}{2}\right )+2 c_1 \right ) {\mathrm e}^{x^{2}}}{2} \]
Mathematica. Time used: 0.064 (sec). Leaf size: 32
ode=D[y[x],x]-2*x*y[x]==Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{x^2} \left (\int _1^xe^{K[1]-K[1]^2}dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 1.852 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*y(x) - exp(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int e^{x} e^{- x^{2}}\, dx - 2 \int x y{\left (x \right )} e^{- x^{2}}\, dx = C_{1} \]