7.2.6 problem 6

Internal problem ID [24]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.3. Problems at page 27
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 10:38:53 AM
CAS classification : [[_linear, `class A`]]

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

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