29.3.1 problem 1

Internal problem ID [7240]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 04:26:08 PM
CAS classification : [[_linear, `class A`]]

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