40.16.5 problem 12

Internal problem ID [6796]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 25. Integration in series. Supplemetary problems. Page 205
Problem number : 12
Date solved : Wednesday, March 05, 2025 at 02:46:02 AM
CAS classification : [_linear]

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

Using series method with expansion around

\begin{align*} 0 \end{align*}

Maple. Time used: 0.000 (sec). Leaf size: 35
Order:=6; 
ode:=(1+x)*diff(y(x),x) = x^2-2*x+y(x); 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = \left (x +1\right ) y \left (0\right )-x^{2}+\frac {2 x^{3}}{3}-\frac {x^{4}}{3}+\frac {x^{5}}{5}+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.027 (sec). Leaf size: 36
ode=(x+1)*D[y[x],x]==x^2-2*x+y[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to \frac {x^5}{5}-\frac {x^4}{3}+\frac {2 x^3}{3}-x^2+c_1 (x+1) \]
Sympy. Time used: 0.915 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + 2*x + (x + 1)*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="1st_power_series",x0=0,n=6)
 
\[ y{\left (x \right )} = - x^{2} + \frac {2 x^{3}}{3} - \frac {x^{4}}{3} + \frac {x^{5}}{5} + C_{1} + C_{1} x + O\left (x^{6}\right ) \]