76.17.19 problem 28

Internal problem ID [17634]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.7 (Variation of parameters). Problems at page 280
Problem number : 28
Date solved : Monday, March 31, 2025 at 04:23:12 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} t^{2} y^{\prime \prime }-2 y&=3 t^{2}-1 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=t^2*diff(diff(y(t),t),t)-2*y(t) = 3*t^2-1; 
dsolve(ode,y(t), singsol=all);
 
\[ y = t^{2} c_2 +\frac {c_1}{t}+t^{2} \ln \left (t \right )+\frac {1}{2} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 31
ode=t^2*D[y[t],{t,2}]-2*y[t]==3*t^2-1; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to t^2 \log (t)+\left (-\frac {1}{3}+c_2\right ) t^2+\frac {c_1}{t}+\frac {1}{2} \]
Sympy. Time used: 0.209 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t**2*Derivative(y(t), (t, 2)) - 3*t**2 - 2*y(t) + 1,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \frac {C_{1} + C_{2} t^{3} + t^{3} \log {\left (t \right )} + \frac {t}{2}}{t} \]