76.15.33 problem 34

Internal problem ID [17595]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.5 (Nonhomogeneous Equations, Method of Undetermined Coefficients). Problems at page 260
Problem number : 34
Date solved : Thursday, March 13, 2025 at 10:37:29 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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