51.4.1 problem 1

Internal problem ID [10358]
Book : First order enumerated odes
Section : section 4. First order odes solved using series method
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 07:22:34 PM
CAS classification : [_separable]

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

Using series method with expansion around

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