63.5.10 problem 2(d)

Internal problem ID [13005]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.4.1. Integrating factors. Exercises page 41
Problem number : 2(d)
Date solved : Wednesday, March 05, 2025 at 08:57:05 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=t*diff(x(t),t) = -x(t)+t^2; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {t^{3}+3 c_{1}}{3 t} \]
Mathematica. Time used: 0.027 (sec). Leaf size: 19
ode=t*D[x[t],t]==-x[t]+t^2; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {t^2}{3}+\frac {c_1}{t} \]
Sympy. Time used: 0.179 (sec). Leaf size: 10
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 + t*Derivative(x(t), t) + x(t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {C_{1} + \frac {t^{3}}{3}}{t} \]