63.5.7 problem 2(a)

Internal problem ID [13010]
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(a)
Date solved : Monday, March 31, 2025 at 07:30:42 AM
CAS classification : [_linear]

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

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