19.1.15 problem 15

Internal problem ID [4227]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 15
Date solved : Tuesday, September 30, 2025 at 07:07:49 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.020 (sec). Leaf size: 12
ode:=diff(y(x),x)-2*x*y(x) = 2*x; 
ic:=[y(0) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -1+2 \,{\mathrm e}^{x^{2}} \]
Mathematica. Time used: 0.027 (sec). Leaf size: 14
ode=D[y[x],x]-2*x*y[x]==2*x; 
ic=y[0]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2 e^{x^2}-1 \end{align*}
Sympy. Time used: 0.159 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*y(x) - 2*x + Derivative(y(x), x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 e^{x^{2}} - 1 \]