12.10.16 problem 16

Internal problem ID [1820]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.7 Variation of Parameters. Page 262
Problem number : 16
Date solved : Saturday, March 29, 2025 at 11:40:29 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.005 (sec). Leaf size: 15
ode:=x^2*diff(diff(y(x),x),x)-(2*a-1)*x*diff(y(x),x)+a^2*y(x) = x^(a+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{a} \left (c_2 +\ln \left (x \right ) c_1 +x \right ) \]
Mathematica. Time used: 0.032 (sec). Leaf size: 19
ode=x^2*D[y[x],{x,2}]-(2*a-1)*x*D[y[x],x]+a^2*y[x]==x^(a+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^a (a c_2 \log (x)+x+c_1) \]
Sympy. Time used: 3.126 (sec). Leaf size: 109
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(a**2*y(x) + x**2*Derivative(y(x), (x, 2)) - x*(2*a - 1)*Derivative(y(x), x) - x**(a + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x^{\operatorname {re}{\left (a\right )}} \left (C_{3} \sin {\left (\log {\left (x \right )} \left |{\operatorname {im}{\left (a\right )}}\right | \right )} + C_{4} \cos {\left (\log {\left (x \right )} \operatorname {im}{\left (a\right )} \right )} + \left (C_{1} \sin {\left (\log {\left (x \right )} \left |{\operatorname {im}{\left (a\right )}}\right | \right )} + C_{2} \cos {\left (\log {\left (x \right )} \operatorname {im}{\left (a\right )} \right )}\right ) \log {\left (x \right )} + \left (\log {\left (x \right )} \int \frac {x^{a - \operatorname {re}{\left (a\right )}}}{\sin {\left (\log {\left (x \right )} \left |{\operatorname {im}{\left (a\right )}}\right | \right )}}\, dx - \int \frac {x^{a - \operatorname {re}{\left (a\right )}} \log {\left (x \right )}}{\sin {\left (\log {\left (x \right )} \left |{\operatorname {im}{\left (a\right )}}\right | \right )}}\, dx\right ) \sin {\left (\log {\left (x \right )} \left |{\operatorname {im}{\left (a\right )}}\right | \right )}\right ) \]