50.3.2 problem 1(b)

Internal problem ID [7826]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 1. What is a differential equation. Section 1.4 First Order Linear Equations. Page 15
Problem number : 1(b)
Date solved : Wednesday, March 05, 2025 at 05:07:20 AM
CAS classification : [_separable]

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

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