At what rate does the temperature away from the Sun decrease? If a piece of iron is right next to the Sun, it will melt. But far away, it'll just stay iron. My question is, in terms of big $\Theta$ notation, how does the temperature a piece of iron feels from the Sun vary with distance from the sun? E.g. $T\in\Theta(1/r^3)$ means that, roughly, doubling the distance means experiencing 1/8th the temperature.
To be clear, I don't want crazy specifics in terms of the radius of the Sun, etc. Assume free space, and a point heat source. E.g. gravity's effect goes as $\Theta(1/r^2)$.
Edit: For those not familiar, Big $\Theta$ notation is used to say that something is roughly proportional in the limit.
 A: The absolute temperature, $T$ of the iron varies with its distance, $r$, from the Sun according to
$$T\propto \frac 1{\sqrt r}.$$
My reasoning is as follows.
If the radiant power of the sun is $L$, the solar energy passing through an imaginary spherical surface of radius $r$, centred on the Sun, per unit time, per unit area will be
$$I=\frac L{4\pi r^2}.$$
So we have an inverse square law of intensity. If we place an iron sphere of radius $a$ at distance $r$ from the Sun, the solar power intercepted will be
$$P=\pi a^2 I=\frac{\pi a^2 L}{4\pi r^2}.$$
The sphere will reach a temperature at which the rate of solar gain is equal to the rate of loss of energy by radiation. We will assume that the sphere absorbs all the intercepted radiation and that it emits as a 'black body' obeying Stefan's law, that is at a power of
$$P_{em}=\sigma A T^4= \sigma 4\pi a^2 T^4$$
in which $\sigma$ is the Stefan constant and $A$ is the surface area. So putting $P=P_{em}$ we get
$$T^4=\frac L {16\pi \sigma r^2},$$
from which follows the relationship given at the top.
The above result will not be accurate if the sphere doesn't absorb and emit as a black body, unless the sphere happened to absorb the same fraction $f$ of the solar power at all wavelengths and angles of incidence (the grey body idealisation). In this case it would also emit only a fraction $f$ of the power predicted by Stefan's law, so the factor of $f$ would cancel. [My misleading original remarks on non-black bodies were pointed out by Bert Barrois.]
Numerical example: We know that $\sigma =5.67 \times 10^{-8}\ \text{W m}^{-2}\text K^{-4}$ and $L=3.63 \times 10^{26}\ \text W$, so if $r=1.50 \times 10^{11}\ \text{m}$ (that is the distance to the Earth from the Sun), we find that $T=274$ K. Plausible?
Note that this answer applies to a macroscopic body, not to the particles making up the interplanetary plasma. Nor should it be applied to a body close to the Sun's surface. These points were raised by the contributor Math Keeps Me Busy.
A: Answer by Philip Wood is good, so I won't repeat it, but I will add an extension to deal with the comment made in the question concerning gravity.
The gravitational force from the Sun varies as $1/r^2$ and that is the end of the story (within Newtonian physics). Nothing can change that fact.
But the temperature of a body at some distance from the Sun, and in thermal equilibrium, is not dictated by the Sun. It depends a lot on the nature of the body. The answer given by Philip Wood is correct for a black body or a grey body. But you can also have a body whose absorptivity (and therefore also emissivity) is larger in the infra-red than in the visible region, and such a body will be colder. Or it can be the other way around. The reason why this is important for this question is that such properties can cause the equilibrium temperature at some distance $r$ from the Sun to vary as some function of $r$ different from $r^{-1/2}$. The $r^{-1/2}$ result is a good ball-park figure to give a sense of what one might expect, but it is nothing like as precise or as universal as the $r^{-2}$ result for gravitational force.
