29.27.7 problem 773

Internal problem ID [5357]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 27
Problem number : 773
Date solved : Tuesday, March 04, 2025 at 09:31:53 PM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

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

Maple. Time used: 0.037 (sec). Leaf size: 28
ode:=diff(y(x),x)^2-2*diff(y(x),x)+a*(x-y(x)) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \frac {a x -1}{a} \\ y \left (x \right ) &= \frac {\left (-c_{1} +x \right )^{2} a}{4}+c_{1} \\ \end{align*}
Mathematica. Time used: 0.317 (sec). Leaf size: 84
ode=(D[y[x],x])^2-2*D[y[x],x]+a*(x-y[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{4} a \left (x^2-2 \sqrt {2} c_1 x+2 c_1{}^2\right )-\frac {1}{a}+x \\ y(x)\to \frac {1}{4} a \left (x^2+2 \sqrt {2} c_1 x+2 c_1{}^2\right )-\frac {1}{a}+x \\ y(x)\to x-\frac {1}{a} \\ \end{align*}
Sympy. Time used: 1.697 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(a*(x - y(x)) + Derivative(y(x), x)**2 - 2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \begin {cases} C_{1} & \text {for}\: a = 0 \\\text {NaN} & \text {otherwise} \end {cases}, \ y{\left (x \right )} = \begin {cases} C_{1} + 2 x & \text {for}\: a = 0 \\\text {NaN} & \text {otherwise} \end {cases}, \ y{\left (x \right )} = \begin {cases} \frac {a \left (C_{1} + x\right )^{2}}{4} + x - \frac {1}{a} & \text {for}\: a \neq 0 \\\text {NaN} & \text {otherwise} \end {cases}\right ] \]