I have issues with solving an equation with integration constants and boundary conditions.
In this case the equation is presented in the image below, where I calculated the problem by my hand and I would like to replicate a similar solution, where I get as a symfun depending on r, and then using vpa to get a numerical value for a specific r, . Boundary conditiions:
I was aiming to write in manner as follows, but the result is not what I expected:
eqn = [A-B/(r1^2)==0, A-B/(r2^2)==-p2];
It is clear that in the code above, the integration constants A, B are firstly solved so that they can be substituted into function . I would prefer to get directly in order to obtain an algorithm to use in other different problems, where the "solving by hand" is not so straightforward.
Thank you in advance