44.6.43 problem 43

Internal problem ID [7187]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.3 Linear equations. Exercises 2.3 at page 63
Problem number : 43
Date solved : Sunday, March 30, 2025 at 11:50:36 AM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (1\right )&=1 \end{align*}

Maple. Time used: 0.079 (sec). Leaf size: 26
ode:=diff(y(x),x)-2*x*y(x) = 1; 
ic:=y(1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x^{2}} \left (\left (\operatorname {erf}\left (1\right )-\operatorname {erf}\left (x \right )\right ) \sqrt {\pi }-2 \,{\mathrm e}^{-1}\right )}{2} \]
Mathematica. Time used: 0.051 (sec). Leaf size: 37
ode=D[y[x],x]-2*x*y[x]==1; 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} e^{x^2-1} \left (e \sqrt {\pi } \text {erf}(x)-e \sqrt {\pi } \text {erf}(1)+2\right ) \]
Sympy. Time used: 0.419 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*y(x) + Derivative(y(x), x) - 1,0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\frac {\sqrt {\pi } \operatorname {erf}{\left (x \right )}}{2} + \frac {- e \sqrt {\pi } \operatorname {erf}{\left (1 \right )} + 2}{2 e}\right ) e^{x^{2}} \]