I am trying to understand how to derive the following formula:  $\frac{dP(r)}{dr}=-\frac{GM(r_&lt;)\rho(r)}{r^2}$  The notes are as follow:  Consider a star with COM and a shell:  $P_1 - P_2 = -{\large\frac{dP}{dr}}\,dr$  ${\large\frac{dP}{dr}} + g\rho = 0$ ( My main issue with the derivation is unsure where this comes from.)  Then if we take $g = {\large\frac{Gm}{r^2}}$ and substitute into the above equation, we get the expected result.  If anyone could explain this derivation to me or an alternative one, it would be much appreciated.
First and foremost I am sorry for this; in order to make the questions clear I must first upload the lecture notes from my institution $^\zeta$ for the derivation of Hydrostatic Equilibrium:          $^\zeta$ Lecture notes courtesy of Imperial College London, Astrophysics dept, 2017-2018 edition.    Firstly, in equation $(3.1)$ why is there no negative sign for $F_g$? Last time I checked, Newton's law of gravitation told us that   $$F=-\frac{GMm}{r^2}$$  Nextly, I have a conceptual problem with equation $(3.2)$; when they use the term 'pressure' I am going to assume that they are referring to the radiation pressure that is released due to nuclear fusion reactions taking place in the sun. In that formula it must be the case that $P(r) \gt P(r+\delta r)$ if this is the case then $(3.2)$ should read $$F_p=-\left(\frac{dP}{dr}\right)\delta r\,\delta A $$   Correct me if I'm wrong but Hydrogen nuclei are fused together to generate the more stable Helium and hence lots of radiation pressure acting outwards from the centre of the star. If this is correct then $P(r+\delta r)=0$, since the outside face of that cylindrical volume element in Figure $3.1$ will not 'feel' any of this radiation pressure because this pressure only acts on the inner face. What am I not understanding here?  Moving on to equation $(3.3)$, let's suppose the sign of the gravitational force in $(3.1)$ really is neglected. Does this mean that the negative sign in $(3.3)$ is due to $P(r+\delta r) \lt P(r)$ and hence $$\frac{GM(r)\rho(r)}{r^2}=-\left(\frac{dP}{dr}\right)\,?$$ I know this is the same equation as in $(3.3)$ but I have written it with the negative sign next to the pressure differential as I would like to know where this minus sign originates from. Does anyone know?  My final concern is the sign in $(3.4)$ as last time I checked $$g=-\frac{GM}{r^2}$$ and not $$g=\frac{GM}{r^2}$$  Hence, equation $(3.4)$ should read  $$\left(\frac{dP}{dr}\right)=\rho(r)\,g\,?$$     I forgot to mention that I have done some research and  is the closest derivation I could find, which, needless to say is no less helpful than the notes I have.
Increment value based on grouped field If $a,b$ are the roots of the equation $2 x^2 -3 x +1 = 0$, find an equation whose roots are $a/(2b +3)$, $b/(2a +3)$ How does DC work with natural 20? Let $F,G,H$ be groups such that $F\trianglelefteq G \trianglelefteq H$.  I am asked whether we necessarily have $F\trianglelefteq H$. I think the answer is no but I cannot find any counterexample with usual groups. Is there a simple case where this property is not true? How to redirect a URL to a custom IP address? I have an Ubuntu machine that I'm using as my home Internet router.  It uses a USB mobile broadband modem as its Internet connection, and shares this with another router (via the router's "Internet" port) which I use as my LAN.  How do I redirect requests from within my LAN for a given URL to a custom IP address (ex have google.com redirect to x.x.x.x)? Get variable from PHP to JavaScript I want to use a PHP variable in JavaScript. How is it possible? I have created screenShot() method to take the screenshot of the web page. When I used this method in my code first time it will capture the screen and it will save the image with image1 name. When I used the same method screenShot() to capture screens for other pages with the use of this.screenShot(); this will again capture the current web page screen but it stores With the same name image1 in the same folder (which overrides to previously captured screen image1).  Now, I have to take screenshots for the number of web pages &amp; want to store it into the same folder with different names like image1, image2, image3...etc. by using the same method screenShot().  public void screenShot() throws IOException, InterruptedException {     File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);     File dest = new File("filPath/image1.png");     FileUtils.copyFile(scr, dest); }   Any workaround to achieve this scenario? Created user can access all databases in PostgreSQL without any grants Is there a CSS selector for elements containing certain text? Wanted: question mark instead of bibtex key for missing citations (biblatex) Instead of having the citation key showing up in the document for missing references, I want to only have [?], as it is the case when using the default bibtex without biblatex. This behavior is driving me crazy, as it messes up all the formatting (especially in tables). I want to focus on writing and only later on deal with the erroneous citations.  This question is related to    and its MWE can be used. However, as pointed out beforehand, I want the question mark in the text instead of the citation key to not mess up the formatting (for missing citations). I’m building a battery powered data logger with a microcontroller and several sensors. I’d like to measure the supply current of individual parts with idle currents in the μA range and peak currents in the low mA range. The current is not constant which rules out a simple multimeter.  Usually I’d (temporarily) replace ferrite beads on the PCB with a 10Ω resistor and measure the voltage drop with my DS1104Z oscilloscope. However, the voltage drop of some μV for 1 or 2 μA of current is simply drowning in the noise and peak currents of ~10mA already result in a noticeable supply drop (so increasing the resistance is out of the question).  I was thinking about building a small board with a 5Ω resistor and OPAMP set to something like 100x amplification, but first wanted to know if this is a good idea or if you know of any affordable, ready-made solutions. Obviously the bandwidth doesn’t have to be high, but some accuracy would be desirable.  Thanks in advance.  Michael headed or heading, started or starting? Consider:  Two units are headed your way. Two units are heading your way. Don't get me started! Don't get me starting!  Is there any difference in meaning? And I don't see why passive voice is used here. I would think they have similar meaning here. Help me to clarify! Testing whether two regression coefficients are significantly different (in R ideally) If this is a duplicate question, please point to the right way, but the similar questions I've found here haven't been sufficiently similar. Suppose I estimate the model $$Y=\alpha + \beta X + u$$  and find that $\beta&gt;0$. However, it turns out that $X=X_1+X_2$, and I suspect $\partial Y/\partial X_1 \ne \partial Y / \partial X_2$, and in particular, that $\partial Y/\partial X_1 &gt; \partial Y / \partial X_2$. So I estimate the model $$Y=\alpha + \beta_1 X_1 + \beta_2 X_2 +u$$and find significant evidence for $\beta_1,\beta_2&gt;0$. How can I then test whether $\beta_1&gt; \beta_2$? I considered running another regression $$Y=\alpha +\gamma(X_1 - X_2) + u$$ And testing whether $\gamma&gt;0$. Is this the best way?  Also, I need to generalize the answer to many variables, i.e. suppose we have $$Y=\alpha + \beta^1 X^1 + \beta ^2 X^2 + \dots + \beta^nX^n + u$$ where for each $j=1,\dots,n$, $X^j=X_1^j+X_2^j$, and I would like to test for each $j$ whether $\partial Y/\partial X_1^j \ne \partial Y / \partial X_2^j$.  By the way, I am primarily working in R. Why are z-values replaced with zero after in_memory use in Python? Making leaflet control open by default I'm using leaflet to display a map.  I have a control section that I'd like to be open by default, but I can't find a way to do it through the . Is there a way to do this? Finding the limit of $\left(\frac{n}{n+1}\right)^n$ Find the limit of: $$\lim_{n\to\infty}\left(\frac{n}{n+1}\right)^n$$   I'm pretty sure it goes to zero since $(n+1)^n &gt; n^n$ but when I input large numbers it goes to $0.36$.  Also, when factoring: $$n^{1/n}\left(\frac{1}{1+\frac1n}\right)^n$$ it looks like it goes to $1$.   So how can I find this limit? Trying to put a footnote in subsection title:  \subsection{Effect of Lateral Confinement on SW Band Structure\footnote{Parts of this sub--section are based on \citet{Venkat2013}}}   produces the following error:  Argument of \@sect has an extra } ...section are based on \citet{Venkat2013}}}   I am using:   \documentclass[paper=A4, fontsize=12, toc=listof, toc=index, toc=bib]{scrreprt}   Please advise. What is the difference between /sbin/nologin and /bin/false? I have often heard it recommended that a user account should be disabled by setting its shell to /bin/false. But, on my existing Linux systems, I see that a great number of existing accounts (all of them service accounts) have a shell of /sbin/nologin instead.  I see from the man page that /sbin/nologin prints a message to the user saying the account is disabled, and then exits. Presumably /bin/false would not print anything.  I also see that /sbin/nologin is listed in /etc/shells, while /bin/false is not.  The man page says that FTP will disable access for users with a shell not listed in /etc/shells and implies that other programs may do the same. Does that mean that somebody could FTP in with an account that has /sbin/nologin as its shell?  What is the difference here? Which one of these should I use to disable a user account, and in what circumstances? What other effects does a listing in /etc/shells have? Stern-Brocot tree where each node has two fathers my circuit is shown on the picture. the problem is the output of the mosfet does't work as desired. For example, If I use Vin=100V and the duty cycle is 50%, the output is Vout=19V.  Anyway, the output is not even near to the desired value. can you help, please?