32.6.16 problem Exercise 12.16, page 103

Internal problem ID [5881]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.16, page 103
Date solved : Tuesday, March 04, 2025 at 11:51:38 PM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.002 (sec). Leaf size: 29
ode:=diff(y(x),x)+a*y(x) = k*exp(b*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {{\mathrm e}^{-a x} \left (k \,{\mathrm e}^{\left (a +b \right ) x}+c_{1} \left (a +b \right )\right )}{a +b} \]
Mathematica. Time used: 0.08 (sec). Leaf size: 33
ode=D[y[x],x]+a*y[x]==k*Exp[b*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-a x} \left (k e^{x (a+b)}+c_1 (a+b)\right )}{a+b} \]
Sympy. Time used: 0.144 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
k = symbols("k") 
y = Function("y") 
ode = Eq(a*y(x) - k*exp(b*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- a x} + \frac {k e^{b x}}{a + b} \]