85.72.3 problem 1 (c)

Internal problem ID [22939]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 7. Solution of differential equations by use of series. A Exercises at page 316
Problem number : 1 (c)
Date solved : Thursday, October 02, 2025 at 09:16:47 PM
CAS classification : [[_linear, `class A`]]

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

Using series method with expansion around

\begin{align*} 0 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 55
Order:=6; 
ode:=diff(y(x),x) = 2*x-y(x); 
dsolve(ode,y(x),type='series',x=0);
 
\[ y = \left (1-x +\frac {1}{2} x^{2}-\frac {1}{6} x^{3}+\frac {1}{24} x^{4}-\frac {1}{120} x^{5}\right ) y \left (0\right )+x^{2}-\frac {x^{3}}{3}+\frac {x^{4}}{12}-\frac {x^{5}}{60}+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.019 (sec). Leaf size: 64
ode=D[y[x],x]==2*x-y[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to -\frac {x^5}{60}+\frac {x^4}{12}-\frac {x^3}{3}+x^2+c_1 \left (-\frac {x^5}{120}+\frac {x^4}{24}-\frac {x^3}{6}+\frac {x^2}{2}-x+1\right ) \]
Sympy. Time used: 0.200 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x + y(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 (C_{1} + 2\right )}{2} - \frac {x^{3} \left (C_{1} + 2\right )}{6} + \frac {x^{4} \left (C_{1} + 2\right )}{24} - \frac {x^{5} \left (C_{1} + 2\right )}{120} + C_{1} - C_{1} x + O\left (x^{6}\right ) \]