40.4.1 problem 19 (a)

Internal problem ID [6641]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 6. Equations of first order and first degree (Linear equations). Supplemetary problems. Page 39
Problem number : 19 (a)
Date solved : Wednesday, March 05, 2025 at 01:34:14 AM
CAS classification : [[_linear, `class A`]]

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

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