25.1.16 problem 16

Internal problem ID [4228]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 16
Date solved : Sunday, March 30, 2025 at 02:43:49 AM
CAS classification : [_separable]

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

With initial conditions

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

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