40.16.2 problem 10A

Internal problem ID [6793]
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 : 10A
Date solved : Sunday, March 30, 2025 at 11:22:59 AM
CAS classification : [_linear]

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

Using series method with expansion around

\begin{align*} 1 \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 18
Order:=6; 
ode:=x*diff(y(x),x) = 1-x+2*y(x); 
dsolve(ode,y(x),type='series',x=1);
 
\[ y = y \left (1\right ) x^{2}-\frac {\left (x -1\right )^{2}}{2} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 28
ode=x*D[y[x],x]==1-x+2*y[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,1,5}]
 
\[ y(x)\to -\frac {1}{2} (x-1)^2+c_1 \left ((x-1)^2+2 (x-1)+1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + x - 2*y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="1st_power_series",x0=1,n=6)
 
ValueError : ODE x*Derivative(y(x), x) + x - 2*y(x) - 1 does not match hint 1st_power_series