20.3.14 problem Problem 14

Internal problem ID [3623]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.6, First-Order Linear Differential Equations. page 59
Problem number : Problem 14
Date solved : Tuesday, March 04, 2025 at 04:55:06 PM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.001 (sec). Leaf size: 27
ode:=diff(y(x),x)+alpha*y(x) = exp(beta*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\left ({\mathrm e}^{x \left (\alpha +\beta \right )}+c_{1} \left (\alpha +\beta \right )\right ) {\mathrm e}^{-\alpha x}}{\alpha +\beta } \]
Mathematica. Time used: 0.053 (sec). Leaf size: 31
ode=D[y[x],x]+\[Alpha]*y[x]==Exp[\[Beta]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{\alpha (-x)} \left (e^{x (\alpha +\beta )}+c_1 (\alpha +\beta )\right )}{\alpha +\beta } \]
Sympy. Time used: 0.140 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
Alpha = symbols("Alpha") 
BETA = symbols("BETA") 
y = Function("y") 
ode = Eq(Alpha*y(x) - exp(BETA*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \mathrm {A} x} + \frac {e^{\beta x}}{\mathrm {A} + \beta } \]