87.17.38 problem 39

Internal problem ID [23630]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 2. Linear differential equations. Exercise at page 127
Problem number : 39
Date solved : Thursday, October 02, 2025 at 09:43:38 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\frac {1}{x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+y(x) = 1/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 -\operatorname {Si}\left (x \right )\right ) \cos \left (x \right )+\sin \left (x \right ) \left (c_2 +\operatorname {Ci}\left (x \right )\right ) \]
Mathematica. Time used: 0.026 (sec). Leaf size: 27
ode=D[y[x],{x,2}]+y[x]==1/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \operatorname {CosIntegral}(x) \sin (x)-\text {Si}(x) \cos (x)+c_1 \cos (x)+c_2 \sin (x) \end{align*}
Sympy. Time used: 0.474 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \operatorname {Si}{\left (x \right )}\right ) \cos {\left (x \right )} + \left (C_{2} - \log {\left (x \right )} + \frac {\log {\left (x^{2} \right )}}{2} + \operatorname {Ci}{\left (x \right )}\right ) \sin {\left (x \right )} \]