87.4.25 problem 37

Internal problem ID [23291]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 37
Problem number : 37
Date solved : Thursday, October 02, 2025 at 09:28:49 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }-2 y x&=x^{2} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=diff(y(x),x)-2*x*y(x) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\sqrt {\pi }\, \operatorname {erf}\left (x \right )+4 c_1 \right ) {\mathrm e}^{x^{2}}}{4}-\frac {x}{2} \]
Mathematica. Time used: 0.054 (sec). Leaf size: 35
ode=D[y[x],x]-2*x*y[x]==x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} \left (\sqrt {\pi } e^{x^2} \text {erf}(x)+4 c_1 e^{x^2}-2 x\right ) \end{align*}
Sympy. Time used: 0.254 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - 2*x*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{x^{2}} - \frac {x}{2} + \frac {\sqrt {\pi } e^{x^{2}} \operatorname {erf}{\left (x \right )}}{4} \]