20.12.11 problem Problem 30

Internal problem ID [3805]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.10, Chapter review. page 575
Problem number : Problem 30
Date solved : Tuesday, March 04, 2025 at 05:17:03 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+x y&=\sin \left (x \right ) \end{align*}

Maple. Time used: 0.039 (sec). Leaf size: 48
ode:=diff(diff(y(x),x),x)+x*y(x) = sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \pi \left (\int \operatorname {AiryBi}\left (-x \right ) \sin \left (x \right )d x \right ) \operatorname {AiryAi}\left (-x \right )-\pi \left (\int \operatorname {AiryAi}\left (-x \right ) \sin \left (x \right )d x \right ) \operatorname {AiryBi}\left (-x \right )+\operatorname {AiryAi}\left (-x \right ) c_{2} +\operatorname {AiryBi}\left (-x \right ) c_{1} \]
Mathematica. Time used: 100.706 (sec). Leaf size: 99
ode=D[y[x],{x,2}]+x*y[x]==Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \operatorname {AiryAi}\left (\sqrt [3]{-1} x\right ) \int _1^x(-1)^{2/3} \pi \operatorname {AiryBi}\left (\sqrt [3]{-1} K[1]\right ) \sin (K[1])dK[1]+\operatorname {AiryBi}\left (\sqrt [3]{-1} x\right ) \int _1^x-(-1)^{2/3} \pi \operatorname {AiryAi}\left (\sqrt [3]{-1} K[2]\right ) \sin (K[2])dK[2]+c_1 \operatorname {AiryAi}\left (\sqrt [3]{-1} x\right )+c_2 \operatorname {AiryBi}\left (\sqrt [3]{-1} x\right ) \]
Sympy. Time used: 0.062 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x) - sin(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} Ai\left (- x\right ) + C_{2} Bi\left (- x\right ) \]