12.1.18 problem Problem 14.24 (a)

Internal problem ID [3474]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.24 (a)
Date solved : Tuesday, September 30, 2025 at 06:39:46 AM
CAS classification : [_linear]

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

With initial conditions

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