71.13.3 problem 3

Internal problem ID [14444]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.2, page 248
Problem number : 3
Date solved : Saturday, February 22, 2025 at 03:48:35 PM
CAS classification : [_quadrature]

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

Using Laplace method

Maple. Time used: 9.592 (sec). Leaf size: 15
ode:=diff(y(x),x)+2*y(x) = 4; 
dsolve(ode,y(x),method='laplace');
 
\[ y = \left (y \left (0\right )-2\right ) {\mathrm e}^{-2 x}+2 \]
Mathematica. Time used: 0.031 (sec). Leaf size: 20
ode=D[y[x],x]+2*y[x]==4; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 2+c_1 e^{-2 x} \\ y(x)\to 2 \\ \end{align*}
Sympy. Time used: 0.114 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) + Derivative(y(x), x) - 4,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + 2 \]