1.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, September 30, 2025 at 03:38:31 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=x -y+1 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=diff(y(x),x) = x-y(x)+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x +{\mathrm e}^{-x} c_1 \]
Mathematica. Time used: 0.027 (sec). Leaf size: 15
ode=D[y[x],x]==x-y[x]+1; 
DSolve[ode,y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x+c_1 e^{-x} \end{align*}
Sympy. Time used: 0.072 (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 \]