80.2.19 problem 26

Internal problem ID [21162]
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 2. Theory of first order differential equations. Excercise 2.6 at page 37
Problem number : 26
Date solved : Thursday, October 02, 2025 at 07:15:04 PM
CAS classification : [_linear]

\begin{align*} x^{\prime }&=x t -t^{3} \end{align*}

With initial conditions

\begin{align*} x \left (a \right )&=a^{2} \\ \end{align*}
Maple. Time used: 0.013 (sec). Leaf size: 22
ode:=diff(x(t),t) = t*x(t)-t^3; 
ic:=[x(a) = a^2]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = t^{2}+2-2 \,{\mathrm e}^{-\frac {\left (a -t \right ) \left (a +t \right )}{2}} \]
Mathematica. Time used: 0.06 (sec). Leaf size: 27
ode=D[x[t],t]==t*x[t]-t^3; 
ic={x[a]==a^2}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -2 e^{\frac {1}{2} \left (t^2-a^2\right )}+t^2+2 \end{align*}
Sympy. Time used: 0.156 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
a = symbols("a") 
x = Function("x") 
ode = Eq(t**3 - t*x(t) + Derivative(x(t), t),0) 
ics = {x(a): a**2} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = t^{2} + 2 - 2 e^{- \frac {a^{2}}{2}} e^{\frac {t^{2}}{2}} \]