# ODE mathematica

h[r_] := (A*r)/(A*r + B);

DSolve[{-2*(1 - Exp[-y[r]]) + r^2*y''[r] +
r^2*(y'[r])^2 - (2 - r*y'[r])*h[r] == 0}, y[r], r]


is giving the following error and a solution that is not correct. Can anyone help to get the correct answer?

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

• ClearAll[y, r, a, b]; DSolve[-2*(1 - Exp[-y[r]]) + r^2*y''[r] + r^2*y'[r]^2 - (2 - r*y'[r])*(a*r)/(a*r + b) == 0, y, r] returns the input in 13 on Windows 10. Feb 28, 2022 at 19:24
• Maple 2021 results in y(r) = ln(-(6*ln((a*r + b)/r)*_C2*a^3*r^3 - 6*ln((a*r + b)/r)*a^2*b^2*r^3 - 6*a^2*b^2*r^3 - 6*_C2*a^2*b*r^2 + 6*a*b^3*r^2 + 3*_C2*a*b^2*r - 6*b^4*r + _C1*r^3 - 2*_C2*b^3)/(6*b^4*r)). Feb 28, 2022 at 19:27
• I do not understand the solution. Are you not getting the error?
– AAA
Feb 28, 2022 at 19:37
• @user64494 can you please tell how did you get the answer?
– AAA
Feb 28, 2022 at 19:46
• The command of Maple dsolve(-2 + 2*exp(-y(r)) + r^2*diff(y(r), r, r) + r^2*diff(y(r), r)^2 - (2 - r*diff(y(r), r))*a*r/(a*r + b) = 0, y(r)) was applied to this end. Feb 28, 2022 at 19:53