62.6.3 problem Ex 3

Internal problem ID [12742]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 13. Linear equations of first order. Page 19
Problem number : Ex 3
Date solved : Wednesday, March 05, 2025 at 08:23:38 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }-\frac {2 y}{1+x}&=\left (1+x \right )^{3} \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=diff(y(x),x)-2*y(x)/(1+x) = (1+x)^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\frac {1}{2} x^{2}+x +c_{1} \right ) \left (x +1\right )^{2} \]
Mathematica. Time used: 0.043 (sec). Leaf size: 22
ode=D[y[x],x]-2*y[x]/(1+x)==(x+1)^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (x+1)^2 \left (\frac {x^2}{2}+x+c_1\right ) \]
Sympy. Time used: 0.362 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x + 1)**3 + Derivative(y(x), x) - 2*y(x)/(x + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x^{2} + 2 C_{1} x + C_{1} + \frac {x^{4}}{2} + 2 x^{3} + \frac {5 x^{2}}{2} + x \]