7.2.19 problem 21

Internal problem ID [37]
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 : 21
Date solved : Tuesday, March 04, 2025 at 10:39:42 AM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

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

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