71.6.8 problem 8

Internal problem ID [14343]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.3.2, page 63
Problem number : 8
Date solved : Monday, March 31, 2025 at 12:18:33 PM
CAS classification : [_separable]

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

With initial conditions

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

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