36.6.19 problem 22

Internal problem ID [6380]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 8, Series solutions of differential equations. Section 8.4. page 449
Problem number : 22
Date solved : Sunday, March 30, 2025 at 10:53:58 AM
CAS classification : [_linear]

\begin{align*} w^{\prime }+x w&={\mathrm e}^{x} \end{align*}

Using series method with expansion around

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

Maple. Time used: 0.004 (sec). Leaf size: 45
Order:=6; 
ode:=diff(w(x),x)+x*w(x) = exp(x); 
dsolve(ode,w(x),type='series',x=0);
 
\[ w = \left (1-\frac {1}{2} x^{2}+\frac {1}{8} x^{4}\right ) w \left (0\right )+x +\frac {x^{2}}{2}-\frac {x^{3}}{6}-\frac {x^{4}}{12}+\frac {x^{5}}{24}+O\left (x^{6}\right ) \]
Mathematica. Time used: 0.012 (sec). Leaf size: 52
ode=D[w[x],x]-x*w[x]==Exp[x]; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},w[x],{x,0,5}]
 
\[ w(x)\to \frac {13 x^5}{120}+\frac {x^4}{6}+\frac {x^3}{2}+\frac {x^2}{2}+c_1 \left (\frac {x^4}{8}+\frac {x^2}{2}+1\right )+x \]
Sympy. Time used: 0.724 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
w = Function("w") 
ode = Eq(x*w(x) - exp(x) + Derivative(w(x), x),0) 
ics = {} 
dsolve(ode,func=w(x),ics=ics,hint="1st_power_series",x0=0,n=6)
 
\[ w{\left (x \right )} = x + \frac {x^{2} \left (1 - C_{1}\right )}{2} - \frac {x^{3}}{6} + \frac {x^{4} \left (3 C_{1} - 2\right )}{24} + \frac {x^{5}}{24} + C_{1} + O\left (x^{6}\right ) \]