44.6.27 problem 27

Internal problem ID [7171]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.3 Linear equations. Exercises 2.3 at page 63
Problem number : 27
Date solved : Sunday, March 30, 2025 at 11:49:59 AM
CAS classification : [_linear]

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

With initial conditions

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

Maple. Time used: 0.033 (sec). Leaf size: 16
ode:=x*diff(y(x),x)+y(x) = exp(x); 
ic:=y(1) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{x}+2-{\mathrm e}}{x} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 28
ode=D[y[x],x]+y[x]==Exp[x]; 
ic={y[1]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} e^{-x} \left (e^{2 x}+4 e-e^2\right ) \]
Sympy. Time used: 0.249 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + y(x) - exp(x),0) 
ics = {y(1): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {e^{x} - e + 2}{x} \]