isothermal: f[x_]=1-x^2/6+x^4/45 g is the approx for M; g=Integrate[4 Pi r1^2 f[r1],{r1,0,r}] g[r_]=4 Pi (r^3/3-r^5/24+r^7/(7*45)) solution=NDSolve[{1/r^2 D[r^2 D[Log[rho[r]],r],r]==-rho[r],rho[0.01]==f[.01],rho'[0.01]==f'[.01]},rho,{r,0.01,10}] Plot[{f[r],Evaluate[{rho[r]}/.First[solution]]},{r,0.01,2}] solution=NDSolve[{1/r^2 D[r^2 D[Log[rho[r]],r],r]==-rho[r],m'[r]==4 Pi rho[r], m[.01]==g[.01],rho[0.01]==f[.01],rho'[0.01]==f'[.01]},{rho,m},{r,0.01,10}] Plot[Evaluate[{rho[r]}/.First[solution]],{r,0.01,10}] solution=NDSolve[{1/r^2 D[r^2 D[Log[rho[r]],r],r]==-rho[r],m'[r]==4 Pi r^2 rho[r], m[.01]==g[.01],rho[0.01]==f[.01],rho'[0.01]==f'[.01]},{rho,m},{r,0.01,1000}] 1/r^2 D[r^2 D[Log[C/r^2],r],r] -2 Out[2]= -- 2 r SO above should be -rho= -C/r^2, C=2 Integrate this rho to get mass: Integrate[4 Pi r1^2 C/r1^2,{r1,0,r}]=8 Pi r Plot[Evaluate[{8 Pi r ,m[r]}/.First[solution]],{r,0.01,1000}] --- reaction energy release: set H1=1007825.03224e-6 H2=2014101.77811E-6 C14=14003241.988E-6 N14=14003074.00446e-6 let me0=me/amu ? (2*H1-H2-me0*2) ! remark: the LHS has two electrons, so the RHS needs 2 electrons+positron ! only one electron was included in 2H, so need to add two electron masses .4511265513423780E-03 !amu ? res*amu*c^2/e 420221.7187498420 !(or .42 MeV) Remark: in the pp reaction, the positron will soon annihilate producing 2*.511 MeV additional Remark2: of this total 1.44 MeV, .26 MeV is in neutrinos (which generally leave the Solar interior without interacting) Remark3: the next step in the pp chain (1H+2H) releases 5.5 MeV, the final step (3He+3He) releases 12.9 MeV ? (C14-N14) ! remark: the LHS has 6 electrons, so the RHS needs 6 electrons + positron ! the N14 came with 7 electrons, so the positron is already included .1679835399990282E-03 !amu ? res*amu*c^2/e 156475.6755948523 ! or .156 MeV