44.3.20 problem 28

Internal problem ID [7001]
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 : Wednesday, March 05, 2025 at 04:01:56 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }-2 x y&={\mathrm e}^{x} \end{align*}

Maple. Time used: 0.003 (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 (-\frac {1}{2}+x \right )+2 c_{1} \right ) {\mathrm e}^{x^{2}}}{2} \]
Mathematica. Time used: 0.104 (sec). Leaf size: 39
ode=D[y[x],x]-2*x*y[x]==Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} e^{x^2} \left (-\sqrt [4]{e} \sqrt {\pi } \text {erf}\left (\frac {1}{2}-x\right )+2 c_1\right ) \]
Sympy. Time used: 3.085 (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} \]