13.10.9 problem 11

Internal problem ID [2410]
Book : Differential equations and their applications, 3rd ed., M. Braun
Section : Section 2.4, The method of variation of parameters. Page 154
Problem number : 11
Date solved : Tuesday, March 04, 2025 at 02:09:56 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+\frac {t^{2} y}{4}&=f \cos \left (t \right ) \end{align*}

Maple. Time used: 0.036 (sec). Leaf size: 81
ode:=diff(diff(y(t),t),t)+1/4*t^2*y(t) = f*cos(t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = -\frac {\sqrt {t}\, \left (f \pi \left (\int \sqrt {t}\, \operatorname {BesselY}\left (\frac {1}{4}, \frac {t^{2}}{4}\right ) \cos \left (t \right )d t \right ) \operatorname {BesselJ}\left (\frac {1}{4}, \frac {t^{2}}{4}\right )-f \pi \left (\int \sqrt {t}\, \operatorname {BesselJ}\left (\frac {1}{4}, \frac {t^{2}}{4}\right ) \cos \left (t \right )d t \right ) \operatorname {BesselY}\left (\frac {1}{4}, \frac {t^{2}}{4}\right )-4 \operatorname {BesselJ}\left (\frac {1}{4}, \frac {t^{2}}{4}\right ) c_2 -4 \operatorname {BesselY}\left (\frac {1}{4}, \frac {t^{2}}{4}\right ) c_1 \right )}{4} \]
Mathematica. Time used: 42.309 (sec). Leaf size: 250
ode=D[y[t],{t,2}]+(1/4*t^2)*y[t]==f*Cos[t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},\sqrt [4]{-1} t\right ) \left (\int _1^t-\frac {i f \cos (K[1]) \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} K[1]\right )}{(-1)^{3/4} \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} K[1]\right ) \operatorname {ParabolicCylinderD}\left (\frac {1}{2},\sqrt [4]{-1} K[1]\right )+\operatorname {ParabolicCylinderD}\left (-\frac {1}{2},\sqrt [4]{-1} K[1]\right ) \left (K[1] \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} K[1]\right )+\sqrt [4]{-1} \operatorname {ParabolicCylinderD}\left (\frac {1}{2},(-1)^{3/4} K[1]\right )\right )}dK[1]+c_1\right )+\operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} t\right ) \left (\int _1^t\frac {i f \cos (K[2]) \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},\sqrt [4]{-1} K[2]\right )}{(-1)^{3/4} \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} K[2]\right ) \operatorname {ParabolicCylinderD}\left (\frac {1}{2},\sqrt [4]{-1} K[2]\right )+\operatorname {ParabolicCylinderD}\left (-\frac {1}{2},\sqrt [4]{-1} K[2]\right ) \left (K[2] \operatorname {ParabolicCylinderD}\left (-\frac {1}{2},(-1)^{3/4} K[2]\right )+\sqrt [4]{-1} \operatorname {ParabolicCylinderD}\left (\frac {1}{2},(-1)^{3/4} K[2]\right )\right )}dK[2]+c_2\right ) \]
Sympy
from sympy import * 
t = symbols("t") 
f = symbols("f") 
y = Function("y") 
ode = Eq(-f*cos(t) + t**2*y(t)/4 + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
NotImplementedError : solve: Cannot solve -f*cos(t) + t**2*y(t)/4 + Derivative(y(t), (t, 2))