Is it possible to obtain a analytical solution for $(A+x^2)e^x=B$, where we want to solve for $x$ with $A,B$ as constants?
2 Answers
You seek a solution in $x$ of the transcendental equation $$e^x(xt_1)(xt_2)=a.$$ (The coefficients $t_1,t_2$ are real for $A<0$, complex otherwise.) The solution $W(t_1,t_2;a)$ is referred to as the "quadratic LambertW function". It is studied in several recent papers:
 General Relativity and Quantum Mechanics: Towards a Generalization of the Lambert W Function (2006)
 On the generalization of the Lambert W function with applications in theoretical physics (2014) [section 4]
 Some physical applications of generalized Lambert functions (2015)
 Generalization of Lambert Wfunction, Bessel polynomials and transcendental equations (2015)
A series expansion is presented in Asymptotic series of Generalized Lambert W Function (see also this MO posting).
The solution to this transcendental algebraic equation is indeed a Generalized Lambert W function and there are a number of papers on the latter, not only the pioneering 2006 AAECC paper mentioned here. See the papers in https://www.researchgate.net/project/GeneralizedLambertWfunction
Granted the second reference, the one by Mezo and Keady claims that the approach used for a particular instance in Physics is 'unsatisfactory' for getting all the solutions but that's an issue of completeness of solutions  not an actual error. Subsequent papers in SIGSAM in that link I just gave, offer more solutions. E.g. check out the most recent publications by Aude Maignan on the ResearchGate project:
https://www.researchgate.net/project/GeneralizedLambertWfunction
Much work has been done since the 2006 paper.

$\begingroup$ The second half of your post might work better as a comment on the other answer; it's more likely to get Carlo Beenakker's attention. $\endgroup$ Jan 2, 2022 at 16:36

$\begingroup$ Thanks but I am new to this forum, I tried to comment on Carlo Beenakker's answer but I was denied permission. I don't have '50 reputation' yet. $\endgroup$ Jan 3, 2022 at 11:16

$\begingroup$ I removed the offending comment, which referred to this criticsm by Mezo and Keady: "For a class of parameters the Scott et al. solution does not give back all the solutions and, in other cases, it gives a virtual solution. One might study exactly when the Scott et al. solution works properly." $\endgroup$ Jan 10, 2022 at 13:07

$\begingroup$ Thank you for the change and clarification. $\endgroup$ Jan 10, 2022 at 13:46