34.12.2 problem 7

Internal problem ID [8037]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 17. Linear equations with variable coefficients (Cauchy and Legndre). Supplemetary problems. Page 110
Problem number : 7
Date solved : Tuesday, September 30, 2025 at 05:14:33 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-2 x y^{\prime }+2 y&=\ln \left (x \right )^{2}-\ln \left (x^{2}\right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 30
ode:=x^2*diff(diff(y(x),x),x)-2*x*diff(y(x),x)+2*y(x) = ln(x)^2-ln(x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_2 x +c_1 \,x^{2}+\frac {\ln \left (x \right )^{2}}{2}+\frac {3 \ln \left (x \right )}{2}-\frac {\ln \left (x^{2}\right )}{2}+\frac {1}{4} \]
Mathematica. Time used: 0.021 (sec). Leaf size: 38
ode=x^2*D[y[x],{x,2}]-2*x*D[y[x],x]+2*y[x]==(Log[x])^2-Log[x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} \left (-2 \log \left (x^2\right )+2 \log ^2(x)+6 \log (x)+1\right )+c_2 x^2+c_1 x \end{align*}
Sympy. Time used: 0.161 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - 2*x*Derivative(y(x), x) + 2*y(x) - log(x)**2 + log(x**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x + C_{2} x^{2} + \frac {\log {\left (x \right )}^{2}}{2} + \frac {\log {\left (x \right )}}{2} + \frac {1}{4} \]