25.1.12 problem 12

Internal problem ID [4224]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 12
Date solved : Tuesday, March 04, 2025 at 05:56:44 PM
CAS classification : [_separable]

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

With initial conditions

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

Maple. Time used: 0.012 (sec). Leaf size: 12
ode:=diff(y(x),x)+2*x*y(x) = 0; 
ic:=y(0) = 5; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = 5 \,{\mathrm e}^{-x^{2}} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 14
ode=D[y[x],x]+2*x*y[x]==0; 
ic=y[0]==5; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 5 e^{-x^2} \]
Sympy. Time used: 0.225 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + Derivative(y(x), x),0) 
ics = {y(0): 5} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 5 e^{- x^{2}} \]