20.12.12 problem Problem 31

Internal problem ID [3806]
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 31
Date solved : Tuesday, March 04, 2025 at 05:17:04 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 60
ode:=diff(diff(y(x),x),x)+4*y(x) = ln(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {i \cos \left (2 x \right ) \pi \left (\operatorname {csgn}\left (x \right )-1\right ) \operatorname {csgn}\left (i x \right )}{8}+\frac {\left (8 c_{1} -2 \,\operatorname {Ci}\left (2 x \right )\right ) \cos \left (2 x \right )}{8}+\frac {\left (\pi \,\operatorname {csgn}\left (x \right )+8 c_{2} -2 \,\operatorname {Si}\left (2 x \right )\right ) \sin \left (2 x \right )}{8}+\frac {\ln \left (x \right )}{4} \]
Mathematica. Time used: 0.05 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+4*y[x]==Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} (-\operatorname {CosIntegral}(2 x) \cos (2 x)-\text {Si}(2 x) \sin (2 x)+\log (x)+4 c_1 \cos (2 x)+4 c_2 \sin (2 x)) \]
Sympy. Time used: 133.545 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - log(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \frac {\operatorname {Ci}{\left (2 x \right )}}{4}\right ) \cos {\left (2 x \right )} + \left (C_{2} - \frac {\operatorname {Si}{\left (2 x \right )}}{4}\right ) \sin {\left (2 x \right )} + \frac {\log {\left (x \right )}}{4} \]