80.1.17 problem 15

Internal problem ID [21135]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 1. First order linear differential equations. Excercise 1.5 at page 13
Problem number : 15
Date solved : Thursday, October 02, 2025 at 07:09:44 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime }+a x&=b t \end{align*}

With initial conditions

\begin{align*} x \left (t_{0} \right )&=x_{0} \\ \end{align*}
Maple. Time used: 0.018 (sec). Leaf size: 38
ode:=diff(x(t),t)+a*x(t) = b*t; 
ic:=[x(t__0) = x__0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \frac {\left (x_{0} a^{2}-b t_{0} a +b \right ) {\mathrm e}^{-a \left (t -t_{0} \right )}+b \left (a t -1\right )}{a^{2}} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 51
ode=D[x[t],t]+a*x[t]==b*t; 
ic={x[t0]==x0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {e^{-a t} \left (a^2 \text {x0} e^{a \text {t0}}+b e^{a t} (a t-1)+b e^{a \text {t0}} (1-a \text {t0})\right )}{a^2} \end{align*}
Sympy. Time used: 0.097 (sec). Leaf size: 44
from sympy import * 
t = symbols("t") 
t0 = symbols("t0") 
x0 = symbols("x0") 
x = Function("x") 
ode = Eq(a*x(t) - b*t + Derivative(x(t), t),0) 
ics = {x(t0): x0} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (x_{0} e^{a t_{0}} - \frac {b t_{0} e^{a t_{0}}}{a} + \frac {b e^{a t_{0}}}{a^{2}}\right ) e^{- a t} + \frac {b t}{a} - \frac {b}{a^{2}} \]