2.4.5 problem 5

Internal problem ID [708]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.5. Linear first order equations. Page 56
Problem number : 5
Date solved : Tuesday, September 30, 2025 at 04:06:42 AM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (1\right )&=5 \\ \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 11
ode:=2*y(x)+x*diff(y(x),x) = 3*x; 
ic:=[y(1) = 5]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = x +\frac {4}{x^{2}} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 12
ode=2*y[x]+x*D[y[x],x] == 3*x; 
ic=y[1]==5; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {4}{x^2}+x \end{align*}
Sympy. Time used: 0.095 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - 3*x + 2*y(x),0) 
ics = {y(1): 5} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x + \frac {4}{x^{2}} \]