38.1.3 problem 3

Internal problem ID [6420]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 3
Date solved : Sunday, March 30, 2025 at 10:55:14 AM
CAS classification : [[_linear, `class A`]]

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

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