14.10.9 problem 9

Internal problem ID [2591]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.4. The method of variation of parameters. Excercises page 156
Problem number : 9
Date solved : Sunday, March 30, 2025 at 12:10:59 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

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