12.2.12 problem 12

Internal problem ID [1548]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Linear first order. Section 2.1 Page 41
Problem number : 12
Date solved : Saturday, March 29, 2025 at 10:58:33 PM
CAS classification : [_quadrature]

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

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