20.4.37 problem Problem 54

Internal problem ID [3672]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 54
Date solved : Sunday, March 30, 2025 at 02:04:01 AM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (9 x -y\right )^{2} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 0.095 (sec). Leaf size: 28
ode:=diff(y(x),x) = (9*x-y(x))^2; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (9 x -3\right ) {\mathrm e}^{6 x}+9 x +3}{1+{\mathrm e}^{6 x}} \]
Mathematica. Time used: 0.154 (sec). Leaf size: 31
ode=D[y[x],x]==(9*x-y[x])^2; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {9 x+e^{6 x} (9 x-3)+3}{e^{6 x}+1} \]
Sympy. Time used: 0.312 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(9*x - y(x))**2 + Derivative(y(x), x),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {3 \left (- 3 x e^{6 x} - 3 x + e^{6 x} - 1\right )}{- e^{6 x} - 1} \]